(
NS(
SELF, ref),
void* ptr,
size_t old_size,
size_t new_size)); \
DC_TRAIT_REFERENCABLE(
SELF); \
DC_TRAIT_DELETABLE(
SELF); \
static DC_PUBLIC void deallocate(SELF *self, void *ptr, size_t size)
static DC_PUBLIC void * allocate_zeroed(SELF *self, size_t size)
static DC_PUBLIC void * allocate_uninit(SELF *self, size_t size)
static DC_PUBLIC void * reallocate(SELF *self, void *ptr, size_t old_size, size_t new_size)
static DC_PUBLIC size_t size(SELF const *self)
#define DC_REQUIRE_METHOD(ret, obj, name, args)
The trait for derive-c allocators. Behaviour is more restrictive that the standard allocator, and provides additional information.
Additiona poisoning is done.
18#define DC_TRAIT_ALLOC(SELF) \
19 DC_REQUIRE_METHOD(void*, SELF, allocate_uninit, (NS(SELF, ref), size_t size)); \
20 DC_REQUIRE_METHOD(void*, SELF, allocate_zeroed, (NS(SELF, ref), size_t size)); \
21 DC_REQUIRE_METHOD(void*, SELF, reallocate, \
22 (NS(SELF, ref), void* ptr, size_t old_size, size_t new_size)); \
23 DC_REQUIRE_METHOD(void, SELF, deallocate, (NS(SELF, ref), void* ptr, size_t size)); \
24 DC_TRAIT_REFERENCABLE(SELF); \
25 DC_TRAIT_DELETABLE(SELF); \
26 DC_TRAIT_DEBUGABLE(SELF)