The mmc memory management functions check a cache for re-usable unused memory before asking the system for it.
More...
Go to the source code of this file.
|
struct | _mm_block |
| Tuple of pointer to allocated memory block and it's size. More...
|
|
#define | __M4RI_MMC_NBLOCKS 16 |
| Number of blocks that are cached.
|
#define | __M4RI_MMC_THRESHOLD __M4RI_CPU_L3_CACHE |
| Maximal size of blocks stored in cache.
|
|
typedef struct _mm_block | mmb_t |
| Tuple of pointer to allocated memory block and it's size.
|
|
void * | m4ri_mmc_malloc (size_t size) |
| Allocate size bytes.
|
void | m4ri_mmc_free (void *condemned, size_t size) |
| Free the data pointed to by condemned of the given size.
|
void | m4ri_mmc_cleanup (void) |
| Cleans up memory block cache.
|
static void * | m4ri_mmc_calloc (size_t count, size_t size) |
| Allocate an array of count times size zeroed bytes.
|
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
◆ m4ri_mmc_calloc()
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.
◆ m4ri_mmc_cleanup()
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.
◆ m4ri_mmc_free()
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. |
◆ m4ri_mmc_malloc()
void * m4ri_mmc_malloc |
( |
size_t | size | ) |
|
Allocate size bytes.
- Parameters
-
- Returns
- pointer to allocated memory block.