Derive-C
Loading...
Searching...
No Matches
std.h File Reference
#include <derive-c/core.h>
#include <derive-c/panic.h>
#include <stdlib.h>
Include dependency graph for std.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  stdalloc
 An allocator for the standard allocator, which only has global state,. More...

Functions

static stdallocget ()
static void * malloc (stdalloc *DEBUG_UNUSED(self), size_t size)
static void * realloc (stdalloc *DEBUG_UNUSED(self), void *ptr, size_t size)
static void * calloc (stdalloc *DEBUG_UNUSED(self), size_t count, size_t size)
static void free (stdalloc *DEBUG_UNUSED(self), void *ptr)

Function Documentation

◆ calloc()

void * calloc ( stdalloc * DEBUG_UNUSEDself,
size_t count,
size_t size )
static

Definition at line 36 of file std.h.

36 {
37 DEBUG_ASSERT(self);
38 return calloc(count, size);
39}
static void * calloc(stdalloc *DEBUG_UNUSED(self), size_t count, size_t size)
Definition std.h:36
#define DEBUG_ASSERT(expr)
Definition panic.h:23
static INDEX_TYPE size(SELF const *self)
Definition template.h:207
Here is the call graph for this function:
Here is the caller graph for this function:

◆ free()

void free ( stdalloc * DEBUG_UNUSEDself,
void * ptr )
static

Definition at line 41 of file std.h.

41 {
42 DEBUG_ASSERT(self);
43 DEBUG_ASSERT(ptr);
44 free(ptr);
45}
static void free(stdalloc *DEBUG_UNUSED(self), void *ptr)
Definition std.h:41
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get()

stdalloc * get ( )
static

Definition at line 20 of file std.h.

20 {
21 static stdalloc instance = {};
22 return &instance;
23}
An allocator for the standard allocator, which only has global state,.
Definition std.h:16
Here is the call graph for this function:

◆ malloc()

void * malloc ( stdalloc * DEBUG_UNUSEDself,
size_t size )
static

Definition at line 25 of file std.h.

25 {
26 DEBUG_ASSERT(self);
27 return malloc(size);
28}
static void * malloc(stdalloc *DEBUG_UNUSED(self), size_t size)
Definition std.h:25
Here is the call graph for this function:
Here is the caller graph for this function:

◆ realloc()

void * realloc ( stdalloc * DEBUG_UNUSEDself,
void * ptr,
size_t size )
static

Definition at line 30 of file std.h.

30 {
31 DEBUG_ASSERT(self);
32 DEBUG_ASSERT(ptr);
33 return realloc(ptr, size);
34}
static void * realloc(stdalloc *DEBUG_UNUSED(self), void *ptr, size_t size)
Definition std.h:30
Here is the call graph for this function:
Here is the caller graph for this function: