fix bad naming

This commit is contained in:
falsycat 2023-11-30 22:01:12 +09:00
parent 90b2ede984
commit 3accae56b6
2 changed files with 5 additions and 5 deletions

View File

@ -7,13 +7,13 @@
#include "util/malloc.h"
#define NF7_REFCNT_DECL(ATTR, T) \
#define NF7_UTIL_REFCNT_DECL(ATTR, T) \
ATTR void T##_ref(struct T*); \
ATTR bool T##_unref(struct T*); \
static_assert(true)
#define NF7_REFCNT_IMPL(ATTR, T, DELETER) \
#define NF7_UTIL_REFCNT_IMPL(ATTR, T, DELETER) \
ATTR void T##_ref(struct T* this) { \
++this->refcnt; \
} \
@ -27,7 +27,7 @@
} \
static_assert(true)
#define NF7_REFCNT_IMPL_ATOMIC(ATTR, T, DELETER) \
#define NF7_UTIL_REFCNT_IMPL_ATOMIC(ATTR, T, DELETER) \
ATTR void T##_ref(struct T* this) { \
atomic_fetch_add(&this->refcnt, 1); \
} \

View File

@ -11,13 +11,13 @@ struct mystruct {
bool deleted;
uint64_t refcnt;
};
NF7_REFCNT_IMPL(static inline, mystruct, {this->deleted = true;});
NF7_UTIL_REFCNT_IMPL(static inline, mystruct, {this->deleted = true;});
struct mystruct_atomic {
bool deleted;
atomic_uint_least64_t refcnt;
};
NF7_REFCNT_IMPL_ATOMIC(static inline, mystruct_atomic, {this->deleted = true;});
NF7_UTIL_REFCNT_IMPL_ATOMIC(static inline, mystruct_atomic, {this->deleted = true;});
NF7_TEST(nf7_util_refcnt_test_delete) {