|
Derive-C
|
#include <stdint.h>#include <string.h>#include <derive-c/alloc/trait.h>#include <derive-c/core/debug/gdb_marker.h>#include <derive-c/core/debug/memory_tracker.h>#include <derive-c/core/prelude.h>#include <derive-c/core/self/def.h>#include <derive-c/core/self/undef.h>

Go to the source code of this file.
Classes | |
| struct | SELF |
| An allocator that prints to stdout when it allocates or frees memory. More... | |
Macros | |
| #define | CAPACITY 1024 |
| A very simple bump allocator making use of a provided fixed size buffer (e.g. statically allocated). | |
| #define | USED uint8_t |
Typedefs | |
| typedef char | buffer[CAPACITY] |
Functions | |
| static SELF | new (buffer *buffer) |
| static void | clear (SELF *self) |
| Clear the allocator, note that all data should be freed before this occurs. | |
| static USED | get_used (SELF const *self) |
| static void * | malloc (SELF *self, size_t size) |
| static void | free (SELF *self, void *ptr) |
| static void * | realloc (SELF *self, void *ptr, size_t new_size) |
| static void * | calloc (SELF *self, size_t count, size_t size) |
| TRAIT_ALLOC (SELF) | |
Variables | |
| static size_t | metadata_size = sizeof(USED) |
| #define CAPACITY 1024 |
A very simple bump allocator making use of a provided fixed size buffer (e.g. statically allocated).
Definition at line 19 of file template.h.
| #define USED uint8_t |
Definition at line 27 of file template.h.
| typedef char buffer[CAPACITY] |
Definition at line 36 of file template.h.
|
static |
Definition at line 189 of file template.h.

|
static |
Clear the allocator, note that all data should be freed before this occurs.
Definition at line 65 of file template.h.


|
static |
Definition at line 110 of file template.h.

Definition at line 86 of file template.h.


|
static |
Definition at line 91 of file template.h.

Definition at line 46 of file template.h.

|
static |
Definition at line 128 of file template.h.

| TRAIT_ALLOC | ( | SELF | ) |
|
static |
Definition at line 44 of file template.h.