|
Derive-C
|
#include <derive-c/core/includes/def.h>#include "includes.h"#include <derive-c/core/alloc/def.h>#include <derive-c/core/self/def.h>#include <derive-c/core/index/bits_to_type/def.h>#include <derive-c/core/index/type_to_strong/def.h>#include <derive-c/utils/slot/template.h>#include <derive-c/core/index/type_to_strong/undef.h>#include <derive-c/core/index/bits_to_type/undef.h>#include <derive-c/core/self/undef.h>#include <derive-c/core/alloc/undef.h>#include <derive-c/core/includes/undef.h>Go to the source code of this file.
Data Structures | |
| struct | value_t |
| struct | SELF |
| An allocator that prints to stdout when it allocates or frees memory. More... | |
| struct | IV_PAIR_CONST |
| struct | ITER_CONST |
| struct | IV_PAIR |
| struct | ITER |
Macros | |
| #define | INDEX_BITS 32 |
| A block based arena that allocated in block doubling in size. TODO(oliverkillane): look at bumaplo. | |
| #define | VALUE value_t |
| #define | VALUE_DELETE value_delete |
| #define | VALUE_CLONE value_clone |
| #define | VALUE_DEBUG value_debug |
| #define | INITIAL_BLOCK_INDEX_BITS 8 |
| #define | SLOT NS(NAME, slot) |
| #define | SLOT_INDEX_TYPE INDEX_TYPE |
| #define | SLOT_VALUE VALUE |
| #define | SLOT_VALUE_CLONE VALUE_CLONE |
| #define | SLOT_VALUE_CLONE VALUE_CLONE |
| #define | SLOT_VALUE_DELETE VALUE_DELETE |
| #define | INTERNAL_NAME SLOT |
| #define | INVARIANT_CHECK(self) |
| #define | IV_PAIR_CONST NS(SELF, iv_const) |
| #define | ITER_CONST NS(SELF, iter_const) |
| #define | IV_PAIR NS(SELF, iv) |
| #define | ITER NS(SELF, iter) |
Typedefs | |
| typedef IV_PAIR_CONST | item |
Functions | |
| static void | VALUE_DELETE (value_t *self) |
| static value_t | VALUE_CLONE (value_t const *self) |
| static void | VALUE_DEBUG (VALUE const *self, dc_debug_fmt fmt, FILE *stream) |
| DC_STATIC_ASSERT (sizeof(VALUE), "VALUE must be a non-zero sized type") | |
| DC_STATIC_ASSERT (INITIAL_BLOCK_INDEX_BITS< INDEX_BITS, "INITIAL_BLOCK_INDEX_BITS must be less than INDEX_BITS") | |
| DC_STATIC_ASSERT (INITIAL_BLOCK_INDEX_BITS > 0, "INITIAL_BLOCK_INDEX_BITS must be greater than zero") | |
| static void PRIV | set_memory_tracking (SELF const *self) |
| static SELF | new (ALLOC *alloc) |
| static INDEX | insert (SELF *self, VALUE value) |
| static VALUE const * | try_read (SELF const *self, INDEX index) |
| static VALUE const * | read (SELF const *self, INDEX index) |
| static VALUE * | try_write (SELF *self, INDEX index) |
| static VALUE * | write (SELF *self, INDEX index) |
| static INDEX_TYPE | size (SELF const *self) |
| static SELF | clone (SELF const *self) |
| static bool | try_remove (SELF *self, INDEX index, VALUE *destination) |
| static VALUE | remove (SELF *self, INDEX index) |
| static void | delete (SELF *self) |
| static IV_PAIR_CONST | iv_const_empty () |
| static bool | empty_item (IV_PAIR_CONST const *item) |
| static IV_PAIR_CONST | next (ITER_CONST *iter) |
| static ITER_CONST | get_iter_const (SELF const *self) |
| static void | debug (SELF const *self, dc_debug_fmt fmt, FILE *stream) |
| static IV_PAIR | iv_empty () |
| static bool | empty_item (IV_PAIR const *item) |
| static IV_PAIR | next (ITER *iter) |
| static ITER | get_iter (SELF *self) |
| DC_TRAIT_ARENA (SELF) | |
Variables | |
| static const size_t | max_entries = MAX_INDEX |
| #define INDEX_BITS 32 |
A block based arena that allocated in block doubling in size. TODO(oliverkillane): look at bumaplo.
Blocks of doubling size are used to allocate elements.
| BitMask | Index | Entries | Offset | Block |
|---|---|---|---|---|
| XXXXX000 | 0 | 8 | 0 | 0 |
| XXXXX111 | 7 | 7 | 0 | |
| XXXX1000 | 8 | 8 | 0 | 1 |
| XXXX1111 | 15 | 7 | 1 | |
| XXX10000 | 16 | 16 | 0 | 2 |
| XXX11111 | 31 | 15 | 2 | |
| XX100000 | 32 | 32 | 0 | 3 |
| XX111111 | 63 | 31 | 3 | |
| X1000000 | 64 | 64 | 0 | 4 |
| X1111111 | 127 | 63 | 4 | |
| 10000000 | 128 | 128 | 0 | 5 |
| 11111111 | 255 | 127 | 5 |
Definition at line 41 of file template.h.
| #define INITIAL_BLOCK_INDEX_BITS 8 |
Definition at line 78 of file template.h.
| #define INTERNAL_NAME SLOT |
Definition at line 98 of file template.h.
| #define INVARIANT_CHECK | ( | self | ) |
Definition at line 142 of file template.h.
Definition at line 510 of file template.h.
Definition at line 377 of file template.h.
Definition at line 497 of file template.h.
Definition at line 364 of file template.h.
Definition at line 91 of file template.h.
| #define SLOT_INDEX_TYPE INDEX_TYPE |
Definition at line 93 of file template.h.
| #define SLOT_VALUE VALUE |
Definition at line 94 of file template.h.
| #define SLOT_VALUE_CLONE VALUE_CLONE |
Definition at line 95 of file template.h.
| #define SLOT_VALUE_CLONE VALUE_CLONE |
Definition at line 95 of file template.h.
| #define SLOT_VALUE_DELETE VALUE_DELETE |
Definition at line 97 of file template.h.
| #define VALUE value_t |
Definition at line 51 of file template.h.
| #define VALUE_CLONE value_clone |
Definition at line 54 of file template.h.
| #define VALUE_DEBUG value_debug |
Definition at line 56 of file template.h.
| #define VALUE_DELETE value_delete |
Definition at line 52 of file template.h.
| typedef IV_PAIR_CONST item |
Definition at line 378 of file template.h.
Definition at line 264 of file template.h.
| DC_STATIC_ASSERT | ( | INITIAL_BLOCK_INDEX_BITS | , |
| 0 | , | ||
| "INITIAL_BLOCK_INDEX_BITS must be greater than zero" | ) |
| DC_STATIC_ASSERT | ( | ) |
| DC_STATIC_ASSERT | ( | sizeof(VALUE) | , |
| "VALUE must be a non-zero sized type" | ) |
| DC_TRAIT_ARENA | ( | SELF | ) |
|
static |
Definition at line 429 of file template.h.
|
static |
Definition at line 342 of file template.h.
|
static |
Definition at line 513 of file template.h.
|
static |
Definition at line 380 of file template.h.
Definition at line 552 of file template.h.
|
static |
Definition at line 419 of file template.h.
Definition at line 173 of file template.h.
|
static |
Definition at line 370 of file template.h.
|
static |
Definition at line 503 of file template.h.
Definition at line 148 of file template.h.
Definition at line 521 of file template.h.
|
static |
Definition at line 388 of file template.h.
Definition at line 245 of file template.h.
Definition at line 333 of file template.h.
Definition at line 119 of file template.h.
|
static |
Definition at line 259 of file template.h.
Definition at line 223 of file template.h.
Definition at line 306 of file template.h.
|
static |
|
static |
Definition at line 255 of file template.h.
|
static |
Definition at line 86 of file template.h.