5#if !defined(SKIP_INCLUDES)
10#if !defined SLOT_INDEX_TYPE
11 #if !defined DC_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 DC_PLACEHOLDERS
21 #define SLOT_VALUE slot_value_t
25 #define SLOT_VALUE_DELETE slot_value_delete
27 #define SLOT_VALUE_CLONE slot_value_clone
28static slot_value_t
SLOT_VALUE_CLONE(slot_value_t
const* self) {
return *self; }
29 #define SLOT_VALUE_DEBUG slot_value_debug
34#if !defined SLOT_VALUE_DELETE
35 #define SLOT_VALUE_DELETE DC_NO_DELETE
38#if !defined SLOT_VALUE_CLONE
39 #define SLOT_VALUE_CLONE DC_COPY_CLONE
42#if !defined SLOT_VALUE_DEBUG
43 #define SLOT_VALUE_DEBUG DC_DEFAULT_DEBUG
70 &slot->present,
sizeof(
bool));
75 slot->present =
false;
76 slot->next_free = next_free;
85 &slot->present,
sizeof(
bool));
95 to_slot->present = from_slot->present;
96 if (from_slot->present) {
105 fprintf(
stream,
"[empty] { next_free: %lu}", (
size_t)self->next_free);
107 fprintf(
stream,
"[full] ");
118#undef SLOT_VALUE_DEBUG
119#undef SLOT_VALUE_CLONE
120#undef SLOT_VALUE_DELETE
122#undef SLOT_INDEX_TYPE
static DC_PUBLIC void debug(SELF const *self, dc_debug_fmt fmt, FILE *stream)
#define SLOT_VALUE_DELETE
#define TEMPLATE_ERROR(...)
With the user provided name, even in nested templates.
static DC_PUBLIC 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
SLOT_INDEX_TYPE next_free
Debug format helpers for debug printin data structures.
static DC_INTERNAL void clone_from(SELF const *from_slot, SELF *to_slot)
#define SLOT_VALUE_DEBUG
A tagged union containing an integer index type.
static DC_INTERNAL void set_empty(SELF *slot, SLOT_INDEX_TYPE next_free)
static DC_INTERNAL void memory_tracker_present(SELF const *slot)
static DC_INTERNAL void fill(SELF *slot, SLOT_VALUE value)
static DC_INTERNAL void memory_tracker_empty(SELF const *slot)
static DC_PUBLIC FILE * stream(SELF *self)