Derive-C
|
#include <stddef.h>
#include <derive-c/allocs/std.h>
#include <derive-c/core.h>
#include <derive-c/panic.h>
#include <derive-c/self.h>
#include <derive-c/allocs/null.h>
#include <derive-c/structures/vector/template.h>
Go to the source code of this file.
Classes | |
struct | TRACKED_ENTRY |
struct | SELF |
Macros | |
#define | ALLOC nullalloc |
For unit tests expected to throw, as C has no unwind, we cannot free allocated memory. This macro wraps the allocator in debug, to allow clearing leaks after an exception. | |
#define | ENTRIES derive_c_entries_placeholder_name |
#define | TRACKED_ENTRY NAME(ENTRIES, entry) |
#define | T TRACKED_ENTRY |
#define | ALLOC stdalloc |
For unit tests expected to throw, as C has no unwind, we cannot free allocated memory. This macro wraps the allocator in debug, to allow clearing leaks after an exception. | |
#define | SELF ENTRIES |
Functions | |
static SELF | new (ALLOC *alloc) |
static ENTRIES const * | get_entries (SELF const *self) |
static void | unleak_and_delete (SELF *self) |
static void * | calloc (SELF *self, size_t count, size_t size) |
static void * | malloc (SELF *self, size_t size) |
static void * | realloc (SELF *self, void *ptr, size_t size) |
static void | free (SELF *self, void *ptr) |
#define ALLOC nullalloc |
For unit tests expected to throw, as C has no unwind, we cannot free allocated memory. This macro wraps the allocator in debug, to allow clearing leaks after an exception.
In release, it is a no-op / pass through.
As this is entirely C, we do not get the niceties of a C++ RAII allocator guard shebang.
Definition at line 21 of file template.h.
#define ALLOC stdalloc |
For unit tests expected to throw, as C has no unwind, we cannot free allocated memory. This macro wraps the allocator in debug, to allow clearing leaks after an exception.
In release, it is a no-op / pass through.
As this is entirely C, we do not get the niceties of a C++ RAII allocator guard shebang.
Definition at line 21 of file template.h.
#define ENTRIES derive_c_entries_placeholder_name |
Definition at line 28 of file template.h.
#define SELF ENTRIES |
Definition at line 70 of file template.h.
#define T TRACKED_ENTRY |
Definition at line 68 of file template.h.
Definition at line 55 of file template.h.
|
static |
Definition at line 102 of file template.h.
|
static |
Definition at line 132 of file template.h.
Definition at line 84 of file template.h.
|
static |
Definition at line 114 of file template.h.
Definition at line 80 of file template.h.
|
static |
Definition at line 126 of file template.h.
|
static |
Definition at line 89 of file template.h.