The mmc memory management functions check a cache for re-usable unused memory before asking the system for it.
More...
#include <m4ri/misc.h>
Go to the source code of this file.
|
struct | _mm_block |
| Tuple of pointer to allocated memory block and it's size. More...
|
|
|
typedef struct _mm_block | mmb_t |
| Tuple of pointer to allocated memory block and it's size.
|
|
The mmc memory management functions check a cache for re-usable unused memory before asking the system for it.
- Author
- Gregory Bard bard@.nosp@m.ford.nosp@m.ham.e.nosp@m.du
-
Martin Albrecht M.R.A.nosp@m.lbre.nosp@m.cht@r.nosp@m.hul..nosp@m.ac.uk
static void* m4ri_mmc_calloc |
( |
size_t |
count, |
|
|
size_t |
size |
|
) |
| |
|
inlinestatic |
Allocate an array of count times size zeroed bytes.
- Parameters
-
count | Number of elements. |
size | Number of bytes per element. |
- Returns
- Pointer to allocated memory block.
void m4ri_mmc_cleanup |
( |
void |
| ) |
|
Cleans up memory block cache.
This function is called automatically when the shared library is unloaded.
- Warning
- Not thread safe.
void m4ri_mmc_free |
( |
void * |
condemned, |
|
|
size_t |
size |
|
) |
| |
Free the data pointed to by condemned of the given size.
- Parameters
-
condemned | Pointer to memory. |
size | Number of bytes. |
void* m4ri_mmc_malloc |
( |
size_t |
size | ) |
|
Allocate size bytes.
- Parameters
-
- Returns
- pointer to allocated memory block.