Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
P-p-H-d committed Nov 9, 2024
1 parent b92bae3 commit 9dbc48a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion m-shared-ptr.h
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ static inline void M_F(name, _write_read_unlock)(shared_t *out, const shared_t

/* Definition of the type with thread safety. */
//TODO: If PROPERTIES.THREADSAFE, disable the global lock as the container handles it itself.
//FIXME: Such a property may need to be more fine tuned than globaly.
//FIXME: Such a property may need to be more fine tuned than globally.
#define M_SHAR3D_PTR_DEF_TYPE(name, shared_t, type, oplist) \
struct M_C(name, _s) { \
type data; /* Allow safe casting from shared_t* to type* */ \
Expand Down Expand Up @@ -712,6 +712,7 @@ M_IF_METHOD(EQUAL, oplist)( \
fattr bool M_F(name, _equal_p)(const shared_t *o1, const shared_t *o2) \
{ \
M_ASSERT(o1 != NULL && o2 != NULL); \
if (o1 == o2) return true; \
/* See comment above on _write_read_lock */ \
if (o1 > o2) { \
M_SWAP(const shared_t *, o1, o2); \
Expand All @@ -732,6 +733,7 @@ M_IF_METHOD(CMP, oplist)( \
{ \
M_ASSERT(o1 != NULL && o2 != NULL); \
int neg = 1; \
if (o1 == o2) return 0; \
/* See comment above on _write_read_lock */ \
if (o1 > o2) { \
M_SWAP(const shared_t *, o1, o2); \
Expand Down
2 changes: 1 addition & 1 deletion tests/test-mshared-ptr.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,4 +215,4 @@ int main(void)
test_array();
test_array_string();
exit(0);
}
}

0 comments on commit 9dbc48a

Please sign in to comment.