5#if !defined(SKIP_INCLUDES)
10#if !defined SLOT_INDEX_TYPE
11 #if !defined PLACEHOLDERS
12TEMPLATE_ERROR(
"A SLOT_INDEX_TYPE needs to be specified for a slot")
14 #define SLOT_INDEX_TYPE int
17#if !defined SLOT_VALUE
18 #if !defined PLACEHOLDERS
21 #define SLOT_VALUE slot_value_t
25 #define SLOT_VALUE_DELETE slot_value_delete
27 #define SLOT_VALUE_CLONE slot_value_clone
29 #define SLOT_VALUE_DEBUG slot_value_debug
33#if !defined SLOT_VALUE_DELETE
34 #define SLOT_VALUE_DELETE DC_NO_DELETE
37#if !defined SLOT_VALUE_CLONE
38 #define SLOT_VALUE_CLONE DC_COPY_CLONE
41#if !defined SLOT_VALUE_DEBUG
42 #define SLOT_VALUE_DEBUG DC_DEFAULT_DEBUG
59 &slot->present,
sizeof(
bool));
64 slot->present =
false;
65 slot->next_free = next_free;
74 &slot->present,
sizeof(
bool));
84 to_slot->present = from_slot->present;
85 if (from_slot->present) {
89 to_slot->next_free = from_slot->next_free;
96 fprintf(
stream,
"[empty] { next_free: %lu}", (
size_t)self->next_free);
98 fprintf(
stream,
"[full] ");
109#undef SLOT_VALUE_DEBUG
110#undef SLOT_VALUE_CLONE
111#undef SLOT_VALUE_DELETE
113#undef SLOT_INDEX_TYPE
static void debug(SELF const *self, dc_debug_fmt fmt, FILE *stream)
#define SLOT_VALUE_DELETE
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
#define TEMPLATE_ERROR(...)
With the user provided name, even in nested templates.
SLOT_INDEX_TYPE next_free
Debug format helpers for debug printin data structures.
#define SLOT_VALUE_DEBUG
A tagged union containing an integer index type.
static void memory_tracker_present(SELF const *slot)
static void clone_from(SELF const *from_slot, SELF *to_slot)
static void memory_tracker_empty(SELF const *slot)
static void set_empty(SELF *slot, SLOT_INDEX_TYPE next_free)
static void fill(SELF *slot, SLOT_VALUE value)
static FILE * stream(SELF *self)
Opens a file for.