#include <stdlib.h>
#include "../common/platform.h"
#include "../common/common_utils.h"
Go to the source code of this file.
Defines | |
#define | MM_MALLOC(size) Memory_malloc( (size) ) |
#define | MM_CALLOC(num, size) Memory_calloc( (num), (size) ) |
#define | MM_REALLOC(memblock, size) Memory_realloc( (memblock), (size) ) |
#define | MM_FREE(memblock) { Memory_free( (memblock) ); ((memblock)) = NULL; } |
#define | MM_OUTOFMEM(name) Memory_outofmem( (name), __FILE__, __LINE__ ) |
#define | MM_MEMCPY memcpy |
Functions | |
void * | Memory_malloc (size_t size) |
Allocates memory blocks. | |
void * | Memory_calloc (size_t num, size_t size) |
Allocates an array in memory with elements initialized to 0. | |
void * | Memory_realloc (void *memblock, size_t size) |
Reallocate memory blocks. | |
void | Memory_free (void *memblock) |
Deallocates or frees a memory block. | |
void | Memory_outofmem (const char *name, const char *file, W32 line) |
Print message out of memory. |
void* Memory_calloc | ( | size_t | num, | |
size_t | size | |||
) |
Allocates an array in memory with elements initialized to 0.
[in] | num | Number of elements. |
[in] | size | Bytes to allocate. |
void Memory_free | ( | void * | memblock | ) |
Deallocates or frees a memory block.
[in] | memblock | Previously allocated memory block to be freed. |
void* Memory_malloc | ( | size_t | size | ) |
Allocates memory blocks.
[in] | size | Bytes to allocate. |
void Memory_outofmem | ( | const char * | name, | |
const char * | file, | |||
W32 | line | |||
) |
Print message out of memory.
[in] | name | Name of function this occurred in. |
[in] | file | File name that this occurred in. |
[in] | line | Line number this occurred on. |
void* Memory_realloc | ( | void * | memblock, | |
size_t | size | |||
) |
Reallocate memory blocks.
[in] | memblock | Pointer to previously allocated memory block. |
[in] | size | Bytes to allocate. |