#include <stddef.h>
#include "host.h"
Go to the source code of this file.
Defines |
#define | JUSTCHECKS 0 |
#define | MEMCHECKS 1 |
#define | FULLMEMCHECKS 2 |
#define | ALLOC_2D_ARRAY(x, y, mem, ptrs, type) |
#define | FREE_2D_ARRAY(mem, ptrs) |
#define | ALLOC_BIG_2D_ARRAY(x, y, mem, ptrs, type) |
#define | FREE_BIG_2D_ARRAY(mem, ptrs) |
Functions |
DLLSYM void | check_mem (const char *string, inT8 level) |
DLLSYM char * | alloc_string (inT32 count) |
DLLSYM void | free_string (char *string) |
DLLSYM void * | alloc_struct (inT32 count, const char *name=NULL) |
DLLSYM void | free_struct (void *deadstruct, inT32 count, const char *name=NULL) |
DLLSYM void * | alloc_mem_p (inT32 count) |
DLLSYM void * | alloc_mem (inT32 count) |
DLLSYM void * | alloc_big_mem (inT32 count) |
DLLSYM void * | alloc_big_zeros (inT32 count) |
DLLSYM void | free_mem (void *oldchunk) |
DLLSYM void | free_big_mem (void *oldchunk) |
Define Documentation
#define ALLOC_2D_ARRAY |
( |
|
x, |
|
|
|
y, |
|
|
|
mem, |
|
|
|
ptrs, |
|
|
|
type |
|
) |
| |
Value:\
{ \
inT32 TMP_i; \
mem=(type*)alloc_mem((x)*(y)*sizeof(type)); \
ptrs=(type**)alloc_mem((x)*sizeof(type*)); \
for (TMP_i=0;TMP_i<(x);TMP_i++)\
ptrs[TMP_i]=mem+(y)*TMP_i; \
} \
#define ALLOC_BIG_2D_ARRAY |
( |
|
x, |
|
|
|
y, |
|
|
|
mem, |
|
|
|
ptrs, |
|
|
|
type |
|
) |
| |
Value:\
{ \
inT32 TMP_i; \
mem=(type*)alloc_big_mem((x)*(y)*sizeof(type)); \
ptrs=(type**)alloc_big_mem((x)*sizeof(type*)); \
for (TMP_i=0;TMP_i<(x);TMP_i++)\
ptrs[TMP_i]=mem+(y)*TMP_i; \
} \
#define FREE_2D_ARRAY |
( |
|
mem, |
|
|
|
ptrs |
|
) |
| |
#define FREE_BIG_2D_ARRAY |
( |
|
mem, |
|
|
|
ptrs |
|
) |
| |
Function Documentation
DLLSYM void* alloc_big_mem |
( |
inT32 |
count | ) |
|
DLLSYM void* alloc_big_zeros |
( |
inT32 |
count | ) |
|
DLLSYM void* alloc_mem |
( |
inT32 |
count | ) |
|
DLLSYM void* alloc_mem_p |
( |
inT32 |
count | ) |
|
DLLSYM char* alloc_string |
( |
inT32 |
count | ) |
|
DLLSYM void* alloc_struct |
( |
inT32 |
count, |
|
|
const char * |
name = NULL |
|
) |
| |
DLLSYM void check_mem |
( |
const char * |
string, |
|
|
inT8 |
level |
|
) |
| |
DLLSYM void free_big_mem |
( |
void * |
oldchunk | ) |
|
DLLSYM void free_mem |
( |
void * |
oldchunk | ) |
|
DLLSYM void free_string |
( |
char * |
string | ) |
|
DLLSYM void free_struct |
( |
void * |
deadstruct, |
|
|
inT32 |
count, |
|
|
const char * |
name = NULL |
|
) |
| |