|
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/container/vector/dynamic/template.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 | slab_info |
| struct | SELF |
| An allocator that prints to stdout when it allocates or frees memory. More... | |
Macros | |
| #define | BLOCK_SIZE 64 |
| A slab allocator for fixed-size allocations with freelist tracking. | |
| #define | SLAB_SIZE 4096 |
| #define | SLAB_VECTOR NS(NAME, slab_vector) |
| #define | ITEM NS(NAME, slab_info) |
| #define | ITEM_CLONE NS(NAME, slab_info_clone) |
| #define | ITEM_DELETE NS(NAME, slab_info_delete) |
| #define | ITEM_DEBUG NS(NAME, slab_info_debug) |
| #define | INTERNAL_NAME SLAB_VECTOR |
Functions | |
| DC_STATIC_ASSERT (BLOCK_SIZE > 0, "Block size must be larger than zero") | |
| DC_STATIC_ASSERT (SLAB_SIZE >=BLOCK_SIZE, "Slab size must be at least block size") | |
| DC_STATIC_ASSERT (BLOCK_SIZE >=sizeof(void *), "Block size must be at least pointer size for freelist") | |
| static slab_info | slab_info_clone (slab_info const *self) |
| static void | slab_info_delete (slab_info *) |
| static void | slab_info_debug (slab_info const *, dc_debug_fmt, FILE *) |
| static DC_PUBLIC SELF | new (ref alloc_ref) |
| static DC_INTERNAL void PRIV | allocate_new_slab (SELF *self) |
| static DC_PUBLIC void * | allocate_uninit (SELF *self, size_t size) |
| static DC_PUBLIC void * | allocate_zeroed (SELF *self, size_t size) |
| static DC_PUBLIC void | deallocate (SELF *self, void *ptr, size_t size) |
| static DC_PUBLIC void * | reallocate (SELF *self, void *ptr, size_t old_size, size_t new_size) |
| static DC_PUBLIC void | reset (SELF *self) |
| static DC_PUBLIC void | delete (SELF *self) |
| static DC_PUBLIC void | debug (SELF const *self, dc_debug_fmt fmt, FILE *stream) |
| DC_TRAIT_REFERENCABLE_BY_PTR (SELF) | |
| DC_TRAIT_ALLOC (SELF) | |
| #define BLOCK_SIZE 64 |
A slab allocator for fixed-size allocations with freelist tracking.
Definition at line 15 of file template.h.
| #define INTERNAL_NAME SLAB_VECTOR |
Definition at line 49 of file template.h.
| #define ITEM_CLONE NS(NAME, slab_info_clone) |
Definition at line 46 of file template.h.
| #define ITEM_DEBUG NS(NAME, slab_info_debug) |
Definition at line 48 of file template.h.
| #define ITEM_DELETE NS(NAME, slab_info_delete) |
Definition at line 47 of file template.h.
| #define SLAB_SIZE 4096 |
Definition at line 22 of file template.h.
Definition at line 30 of file template.h.
|
static |
Definition at line 70 of file template.h.
Definition at line 92 of file template.h.
Definition at line 123 of file template.h.
| DC_STATIC_ASSERT | ( | BLOCK_SIZE | , |
| 0 | , | ||
| "Block size must be larger than zero" | ) |
| DC_STATIC_ASSERT | ( | BLOCK_SIZE >= | sizeofvoid *, |
| "Block size must be at least pointer size for freelist" | ) |
| DC_TRAIT_ALLOC | ( | SELF | ) |
| DC_TRAIT_REFERENCABLE_BY_PTR | ( | SELF | ) |
Definition at line 133 of file template.h.
|
static |
Definition at line 204 of file template.h.
Definition at line 197 of file template.h.
Definition at line 61 of file template.h.
Definition at line 153 of file template.h.
Definition at line 182 of file template.h.
Definition at line 38 of file template.h.
|
static |
Definition at line 42 of file template.h.
|
static |
Definition at line 41 of file template.h.