Go to the source code of this file.
|
| struct | SELF |
| | An allocator that prints to stdout when it allocates or frees memory. More...
|
◆ SLOT_VALUE_DEBUG
A tagged union containing an integer index type.
Definition at line 42 of file template.h.
◆ clone_from()
| void clone_from |
( |
SELF const * | from_slot, |
|
|
SELF * | to_slot ) |
|
static |
Definition at line 83 of file template.h.
83 {
84 to_slot->
present = from_slot->present;
85 if (from_slot->present) {
88 } else {
89 to_slot->
next_free = from_slot->next_free;
91 }
92}
SLOT_INDEX_TYPE next_free
static void memory_tracker_present(SELF const *slot)
static void memory_tracker_empty(SELF const *slot)
◆ debug()
Definition at line 94 of file template.h.
94 {
95 if (self->present) {
96 fprintf(
stream,
"[empty] { next_free: %lu}", (
size_t)self->next_free);
97 } else {
98 fprintf(
stream,
"[full] ");
100 }
101}
#define SLOT_VALUE_DEBUG
A tagged union containing an integer index type.
static FILE * stream(SELF *self)
Opens a file for.
◆ delete()
| void delete |
( |
SELF * | self | ) |
|
|
static |
Definition at line 103 of file template.h.
103 {
106 }
107}
#define SLOT_VALUE_DELETE
◆ fill()
◆ memory_tracker_empty()
| void memory_tracker_empty |
( |
SELF const * | slot | ) |
|
|
static |
Definition at line 53 of file template.h.
53 {
59 &slot->present, sizeof(bool));
60}
static void dc_memory_tracker_set(dc_memory_tracker_level level, dc_memory_tracker_capability cap, const volatile void *addr, size_t size)
@ DC_MEMORY_TRACKER_LVL_CONTAINER
@ DC_MEMORY_TRACKER_CAP_WRITE
@ DC_MEMORY_TRACKER_CAP_NONE
@ DC_MEMORY_TRACKER_CAP_READ_WRITE
◆ memory_tracker_present()
| void memory_tracker_present |
( |
SELF const * | slot | ) |
|
|
static |
Definition at line 68 of file template.h.
68 {
74 &slot->present, sizeof(bool));
75}
◆ set_empty()