|
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_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 *) |
| static value_t | VALUE_CLONE (value_t const *self) |
| static void | VALUE_DEBUG (VALUE const *, dc_debug_fmt, FILE *) |
| 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 DC_PUBLIC SELF | new (ref alloc_ref) |
| static DC_PUBLIC INDEX | insert (SELF *self, VALUE value) |
| static DC_PUBLIC VALUE const * | try_read (SELF const *self, INDEX index) |
| static DC_PUBLIC VALUE const * | read (SELF const *self, INDEX index) |
| static DC_PUBLIC VALUE * | try_write (SELF *self, INDEX index) |
| static DC_PUBLIC VALUE * | write (SELF *self, INDEX index) |
| static DC_PUBLIC size_t | size (SELF const *self) |
| static DC_PUBLIC SELF | clone (SELF const *self) |
| static DC_PUBLIC bool | try_remove (SELF *self, INDEX index, VALUE *destination) |
| static DC_PUBLIC VALUE | remove (SELF *self, INDEX index) |
| static DC_PUBLIC void | delete (SELF *self) |
| static DC_PUBLIC IV_PAIR_CONST | iv_const_empty () |
| static DC_PUBLIC bool | empty_item (IV_PAIR_CONST const *item) |
| static DC_PUBLIC IV_PAIR_CONST | next (ITER_CONST *iter) |
| static DC_PUBLIC bool | empty (ITER_CONST const *iter) |
| static DC_PUBLIC ITER_CONST | get_iter_const (SELF const *self) |
| static DC_PUBLIC void | debug (SELF const *self, dc_debug_fmt fmt, FILE *stream) |
| static DC_PUBLIC IV_PAIR | iv_empty () |
| static DC_PUBLIC bool | empty_item (IV_PAIR const *item) |
| static DC_PUBLIC IV_PAIR | next (ITER *iter) |
| static DC_PUBLIC bool | empty (ITER const *iter) |
| static DC_PUBLIC 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 97 of file template.h.
| #define INVARIANT_CHECK | ( | self | ) |
Definition at line 117 of file template.h.
Definition at line 509 of file template.h.
Definition at line 346 of file template.h.
Definition at line 496 of file template.h.
Definition at line 333 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_DELETE VALUE_DELETE |
Definition at line 96 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 347 of file template.h.
Definition at line 240 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 428 of file template.h.
Definition at line 310 of file template.h.
Definition at line 551 of file template.h.
|
static |
Definition at line 390 of file template.h.
Definition at line 512 of file template.h.
|
static |
Definition at line 349 of file template.h.
Definition at line 579 of file template.h.
|
static |
Definition at line 418 of file template.h.
Definition at line 147 of file template.h.
|
static |
Definition at line 339 of file template.h.
Definition at line 502 of file template.h.
Definition at line 123 of file template.h.
Definition at line 520 of file template.h.
|
static |
Definition at line 359 of file template.h.
Definition at line 219 of file template.h.
Definition at line 300 of file template.h.
Definition at line 235 of file template.h.
Definition at line 197 of file template.h.
Definition at line 273 of file template.h.
Definition at line 55 of file template.h.
|
static |
Definition at line 57 of file template.h.
|
static |
Definition at line 53 of file template.h.
Definition at line 229 of file template.h.
|
static |
Definition at line 86 of file template.h.