![]() |
![]() |
Defines | |
#define | gx_globalrealloc_dbg(buf, sbuf, f, l) gx_globalrealloc(buf,sbuf) |
Release/Debug workaround. | |
#define | gx_globalalloc_dbg(buf, sbuf, f, l) gx_globalalloc(buf,sbuf) |
Release/Debug workaround. | |
Functions | |
static int | gx_globalrealloc (void **buffer, int sbuffer) |
Reallocates or frees a previously allocated memory area or allocates a new area. | |
static int | gx_globalalloc (void **buffer, int sbuffer) |
Allocates a memory area that can be passed between modules. | |
static int | gx_globalfree (void *buffer) |
Frees a previously allocated memory area. | |
static int | gx_globalsize (int *sbuffer, void *buffer) |
Gets the size of a previously allocated memory area in bytes. | |
static int | gx_globalrealloc_dbg (void **buffer, int sbuffer, const char *file, int line) |
Reallocates or frees a previously allocated memory area or allocates a new area (Debug version). | |
static int | gx_globalalloc_dbg (void **buffer, int sbuffer, const char *file, int line) |
Allocates a memory area that can be passed between modules (Debug version). | |
static int | gx_globalcheck_dbg () |
Checks the memory consistency previously allocated with the gx_globalalloc() or gx_globalrealloc() functions (Debug version). | |
static int | gx_globaltestmem_dbg (int index, char *fnbuffer, int fnbsize, char *membuffer, int mbsize, int *line, int *size, void **address) |
Returns details about the unfreed memory previously allocated with the gx_globalalloc() or gx_globalrealloc() functions (Debug version). | |
static int | gx_creatememslot (int *handle, void **mem) |
Allocates a memory slot and returns a handle to it. | |
static int | gx_getmemslot (int handle, void **mem) |
Returns the memory pointer to use on data update. | |
static int | gx_unrefmemslot (int handle) |
Decrements the memory slot's reference counter. |
#define gx_globalrealloc_dbg | ( | buf, | |||
sbuf, | |||||
f, | |||||
l | ) | gx_globalrealloc(buf,sbuf) |
#define gx_globalalloc_dbg | ( | buf, | |||
sbuf, | |||||
f, | |||||
l | ) | gx_globalalloc(buf,sbuf) |
Release/Debug workaround.
static int gx_globalrealloc | ( | void ** | buffer, | |
int | sbuffer | |||
) | [static] |
Reallocates or frees a previously allocated memory area or allocates a new area.
buffer | Pointer to a memory area pointer where the function receives the address of a previously allocated memory area and where it writes the address of the reallocated area. This function is also suitable for allocation if the value of *buffer is zero. If sbuffer is zero the function frees the specified memory area. | |
sbuffer | Size of the new memory area in bytes. If it is zero it frees the area. |
References gx_call().
Referenced by gx_globalalloc(), and gx_globalfree().
static int gx_globalalloc | ( | void ** | buffer, | |
int | sbuffer | |||
) | [static] |
Allocates a memory area that can be passed between modules.
buffer | Pointer to a memory area pointer where the function writes the address of the newly allocated area. If the original value of the pointer was non-zero the memory area will be lost after the allocation. | |
sbuffer | Size of the memory area to allocate. |
References gx_globalrealloc().
static int gx_globalfree | ( | void * | buffer | ) | [static] |
Frees a previously allocated memory area.
buffer | Pointer to a memory area. |
References gx_globalrealloc().
static int gx_globalsize | ( | int * | sbuffer, | |
void * | buffer | |||
) | [static] |
Gets the size of a previously allocated memory area in bytes.
sbuffer | Pointer where the function writes the size of the area. | |
buffer | Pointer to the memory area. |
References gx_call().
static int gx_globalrealloc_dbg | ( | void ** | buffer, | |
int | sbuffer, | |||
const char * | file, | |||
int | line | |||
) | [static] |
Reallocates or frees a previously allocated memory area or allocates a new area (Debug version).
buffer | Pointer to a memory area pointer where the function receives the address of a previously allocated memory area and where it writes the address of the reallocated area. This function is also suitable for allocation if the value of *buffer is zero. If sbuffer is zero the function frees the specified memory area. | |
sbuffer | Size of the new memory area in bytes. If it is zero it frees the area. | |
file | File name. | |
line | Line number. |
References gx_call().
static int gx_globalalloc_dbg | ( | void ** | buffer, | |
int | sbuffer, | |||
const char * | file, | |||
int | line | |||
) | [static] |
Allocates a memory area that can be passed between modules (Debug version).
buffer | Pointer to a memory area pointer where the function writes the address of the newly allocated area. If the original value of the pointer was non-zero the memory area will be lost after the allocation. | |
sbuffer | Size of the memory area to allocate. | |
file | File name. | |
line | Line number. |
References gx_globalrealloc_dbg.
static int gx_globalcheck_dbg | ( | ) | [static] |
Checks the memory consistency previously allocated with the gx_globalalloc() or gx_globalrealloc() functions (Debug version).
References gx_call().
static int gx_globaltestmem_dbg | ( | int | index, | |
char * | fnbuffer, | |||
int | fnbsize, | |||
char * | membuffer, | |||
int | mbsize, | |||
int * | line, | |||
int * | size, | |||
void ** | address | |||
) | [static] |
Returns details about the unfreed memory previously allocated with the gx_globalalloc() or gx_globalrealloc() functions (Debug version).
index | The index of the allocated memory (global). | |
fnbuffer | Preallocated buffer for returning the file name where the allocation happened. | |
fnbsize | The size of the preallocated file name buffer. | |
membuffer | Preallocated buffer for returning the memory content (human readable format). | |
mbsize | The size of the preallocated memory content buffer. | |
line | The line number where the allocation happened. | |
size | The size of the allocated memory area. | |
address | Pointer for returning the allocate memory address. |
References gx_call().
static int gx_creatememslot | ( | int * | handle, | |
void ** | mem | |||
) | [static] |
Allocates a memory slot and returns a handle to it.
handle | Preallocated buffer for the result. | |
mem | Preallocated buffer for getting the memslot address. |
References gx_call().
static int gx_getmemslot | ( | int | handle, | |
void ** | mem | |||
) | [static] |
Returns the memory pointer to use on data update.
handle | The handle of the memslot. | |
mem | Preallocated buffer for the result. |
References gx_call().
static int gx_unrefmemslot | ( | int | handle | ) | [static] |
Decrements the memory slot's reference counter.
handle | The handle of the memslot. |
References gx_call().