ELinks 0.18.0
|
Macros | |
#define | ALLOC_MAXTRIES 3 |
Max. | |
#define | ALLOC_DELAY 3 |
Delay in seconds between each alloc try. | |
#define | fmem_alloc(x) mem_alloc(x) |
#define | fmem_free(x) mem_free(x) |
#define | mem_mmap_alloc(x) mem_alloc(x) |
Cygwin wants some size_t definition here... let's try to make it happy then. | |
#define | mem_mmap_free(x, y) mem_free(x) |
#define | mem_mmap_realloc(x, y, z) mem_realloc(x, z) |
#define | intdup(i) intdup__(i) |
Maybe-free macros | |
| |
#define | mem_free_set(x, v) do { if (*(x)) mem_free(*(x)); *(x) = (v); } while (0) |
#define | mem_free_if(x) do { void *p = (x); if (p) mem_free(p); } while (0) |
Functions | |
void * | mem_alloc (size_t) |
void * | mem_calloc (size_t, size_t) |
void | mem_free (void *) |
void * | mem_realloc (void *, size_t) |
static int * | intdup__ (int i) |
Granular memory allocation. | |
The granularity used by the aligned memory functions below must be a mask with all bits set from but not including the most significant bit and down. So if an alignment of 256 is wanted use 0xFF. | |
#define | ALLOC_GR 0x100 |
The 'old' style granularity. | |
#define | ALIGN_MEMORY_SIZE(x, gr) (((x) + (gr)) & ~(gr)) |
#define | mem_align_alloc(ptr, old, new_, mask) mem_align_alloc__((void **) ptr, old, new_, sizeof(**ptr), mask) |
static void * | mem_align_alloc__ (void **ptr, size_t old, size_t new_, size_t objsize, size_t mask) |
#define ALIGN_MEMORY_SIZE | ( | x, | |
gr ) (((x) + (gr)) & ~(gr)) |
#define ALLOC_DELAY 3 |
Delay in seconds between each alloc try.
#define ALLOC_GR 0x100 |
The 'old' style granularity.
XXX: Must be power of 2
#define ALLOC_MAXTRIES 3 |
Max.
number of retry in case of memory allocation failure.
#define fmem_alloc | ( | x | ) | mem_alloc(x) |
#define fmem_free | ( | x | ) | mem_free(x) |
#define mem_align_alloc | ( | ptr, | |
old, | |||
new_, | |||
mask ) mem_align_alloc__((void **) ptr, old, new_, sizeof(**ptr), mask) |
#define mem_free_if | ( | x | ) | do { void *p = (x); if (p) mem_free(p); } while (0) |
#define mem_free_set | ( | x, | |
v ) do { if (*(x)) mem_free(*(x)); *(x) = (v); } while (0) |
#define mem_mmap_alloc | ( | x | ) | mem_alloc(x) |
Cygwin wants some size_t definition here... let's try to make it happy then.
Hrmpf.
#define mem_mmap_free | ( | x, | |
y ) mem_free(x) |
#define mem_mmap_realloc | ( | x, | |
y, | |||
z ) mem_realloc(x, z) |
|
inlinestatic |
|
inlinestatic |
void * mem_alloc | ( | size_t | ) |
void * mem_calloc | ( | size_t | , |
size_t | ) |
void mem_free | ( | void * | ) |
void * mem_realloc | ( | void * | , |
size_t | ) |