diff --git a/docs/annotated.html b/docs/annotated.html new file mode 100644 index 00000000..c4f55c78 --- /dev/null +++ b/docs/annotated.html @@ -0,0 +1,121 @@ + + +
+ + + + +Cmi_heap_area_t | An area of heap space contains blocks of a single size |
We tested mimalloc against many other top allocators over a wide range of benchmarks, ranging from various real world programs to synthetic benchmarks that see how the allocator behaves under more extreme circumstances.
+In our benchmarks, mimalloc always outperforms all other leading allocators (jemalloc, tcmalloc, Hoard, etc) (Apr 2019), and usually uses less memory (up to 25% more in the worst case). A nice property is that it does consistently well over the wide range of benchmarks.
+See the Performance section in the mimalloc repository for benchmark results, or the the technical report for detailed benchmark results.
+Checkout the sources from Github:
Open ide/vs2017/mimalloc.sln
in Visual Studio 2017 and build. The mimalloc
project builds a static library (in out/msvc-x64
), while the mimalloc-override
project builds a DLL for overriding malloc in the entire program.
We use cmake
1 as the build system:
This builds the library as a shared (dynamic) library (.so
or .dylib
), a static library (.a
), and as a single object file (.o
).
> sudo make install
(install the library and header files in /usr/local/lib
and /usr/local/include
)
You can build the debug version which does many internal checks and maintains detailed statistics as:
+ This will name the shared library as libmimalloc-debug.so
.
Finally, you can build a secure version that uses guard pages, encrypted free lists, etc, as:
This will name the shared library as libmimalloc-secure.so
. Use ccmake
2 instead of cmake
to see and customize all the available build options.
Notes:
sudo apt-get install cmake
sudo apt-get install cmake-curses-gui
Allocating aligned memory blocks. +More...
++Functions | |
void * | mi_malloc_aligned (size_t size, size_t alignment) |
Allocate size bytes aligned by alignment. More... | |
void * | mi_zalloc_aligned (size_t size, size_t alignment) |
void * | mi_calloc_aligned (size_t count, size_t size, size_t alignment) |
void * | mi_realloc_aligned (void *p, size_t newsize, size_t alignment) |
void * | mi_rezalloc_aligned (void *p, size_t newsize, size_t alignment) |
void * | mi_recalloc_aligned (void *p, size_t count, size_t size, size_t alignment) |
void * | mi_malloc_aligned_at (size_t size, size_t alignment, size_t offset) |
Allocate size bytes aligned by alignment at a specified offset. More... | |
void * | mi_zalloc_aligned_at (size_t size, size_t alignment, size_t offset) |
void * | mi_calloc_aligned_at (size_t count, size_t size, size_t alignment, size_t offset) |
void * | mi_realloc_aligned_at (void *p, size_t newsize, size_t alignment, size_t offset) |
void * | mi_rezalloc_aligned_at (void *p, size_t newsize, size_t alignment, size_t offset) |
void * | mi_recalloc_aligned_at (void *p, size_t count, size_t size, size_t alignment, size_t offset) |
Allocating aligned memory blocks.
+void* mi_calloc_aligned | +( | +size_t | +count, | +
+ | + | size_t | +size, | +
+ | + | size_t | +alignment | +
+ | ) | ++ |
void* mi_calloc_aligned_at | +( | +size_t | +count, | +
+ | + | size_t | +size, | +
+ | + | size_t | +alignment, | +
+ | + | size_t | +offset | +
+ | ) | ++ |
void* mi_malloc_aligned | +( | +size_t | +size, | +
+ | + | size_t | +alignment | +
+ | ) | ++ |
Allocate size bytes aligned by alignment.
+size | number of bytes to allocate. |
alignment | the minimal alignment of the allocated memory. |
(uintptr_t)p % alignment == 0
.Returns a unique pointer if called with size 0.
void* mi_malloc_aligned_at | +( | +size_t | +size, | +
+ | + | size_t | +alignment, | +
+ | + | size_t | +offset | +
+ | ) | ++ |
Allocate size bytes aligned by alignment at a specified offset.
+size | number of bytes to allocate. |
alignment | the minimal alignment of the allocated memory at offset. |
offset | the offset that should be aligned. |
((uintptr_t)p + offset) % alignment == 0
.Returns a unique pointer if called with size 0.
void* mi_realloc_aligned | +( | +void * | +p, | +
+ | + | size_t | +newsize, | +
+ | + | size_t | +alignment | +
+ | ) | ++ |
void* mi_realloc_aligned_at | +( | +void * | +p, | +
+ | + | size_t | +newsize, | +
+ | + | size_t | +alignment, | +
+ | + | size_t | +offset | +
+ | ) | ++ |
void* mi_recalloc_aligned | +( | +void * | +p, | +
+ | + | size_t | +count, | +
+ | + | size_t | +size, | +
+ | + | size_t | +alignment | +
+ | ) | ++ |
void* mi_recalloc_aligned_at | +( | +void * | +p, | +
+ | + | size_t | +count, | +
+ | + | size_t | +size, | +
+ | + | size_t | +alignment, | +
+ | + | size_t | +offset | +
+ | ) | ++ |
void* mi_rezalloc_aligned | +( | +void * | +p, | +
+ | + | size_t | +newsize, | +
+ | + | size_t | +alignment | +
+ | ) | ++ |
void* mi_rezalloc_aligned_at | +( | +void * | +p, | +
+ | + | size_t | +newsize, | +
+ | + | size_t | +alignment, | +
+ | + | size_t | +offset | +
+ | ) | ++ |
void* mi_zalloc_aligned | +( | +size_t | +size, | +
+ | + | size_t | +alignment | +
+ | ) | ++ |
void* mi_zalloc_aligned_at | +( | +size_t | +size, | +
+ | + | size_t | +alignment, | +
+ | + | size_t | +offset | +
+ | ) | ++ |
Inspect the heap at runtime. +More...
++Data Structures | |
struct | mi_heap_area_t |
An area of heap space contains blocks of a single size. More... | |
+Typedefs | |
typedef bool() | mi_block_visit_fun(const mi_heap_t *heap, const mi_heap_area_t *area, void *block, size_t block_size, void *arg) |
Visitor function passed to mi_heap_visit_blocks() More... | |
+Functions | |
bool | mi_heap_contains_block (mi_heap_t *heap, const void *p) |
Does a heap contain a pointer to a previously allocated block? More... | |
bool | mi_heap_check_owned (mi_heap_t *heap, const void *p) |
Check safely if any pointer is part of a heap. More... | |
bool | mi_check_owned (const void *p) |
Check safely if any pointer is part of the default heap of this thread. More... | |
bool | mi_heap_visit_blocks (const mi_heap_t *heap, bool visit_all_blocks, mi_block_visit_fun *visitor, void *arg) |
Visit all areas and blocks in a heap. More... | |
Inspect the heap at runtime.
+struct mi_heap_area_t | +
An area of heap space contains blocks of a single size.
+The bytes in freed blocks are committed - used
.
typedef bool() mi_block_visit_fun(const mi_heap_t *heap, const mi_heap_area_t *area, void *block, size_t block_size, void *arg) | +
Visitor function passed to mi_heap_visit_blocks()
+This function is always first called for every area with block as a NULL pointer. If visit_all_blocks was true, the function is then called for every allocated block in that area.
+ +bool mi_check_owned | +( | +const void * | +p | ) | ++ |
Check safely if any pointer is part of the default heap of this thread.
+p | Any pointer – not required to be previously allocated by us. |
Note: expensive function, linear in the pages in the heap.
bool mi_heap_check_owned | +( | +mi_heap_t * | +heap, | +
+ | + | const void * | +p | +
+ | ) | ++ |
Check safely if any pointer is part of a heap.
+heap | The heap. |
p | Any pointer – not required to be previously allocated by us. |
Note: expensive function, linear in the pages in the heap.
bool mi_heap_contains_block | +( | +mi_heap_t * | +heap, | +
+ | + | const void * | +p | +
+ | ) | ++ |
Does a heap contain a pointer to a previously allocated block?
+heap | The heap. |
p | Pointer to a previously allocated block (in any heap)– cannot be some random pointer! |
bool mi_heap_visit_blocks | +( | +const mi_heap_t * | +heap, | +
+ | + | bool | +visit_all_blocks, | +
+ | + | mi_block_visit_fun * | +visitor, | +
+ | + | void * | +arg | +
+ | ) | ++ |
Visit all areas and blocks in a heap.
+heap | The heap to visit. |
visit_all_blocks | If true visits all allocated blocks, otherwise visitor is only called for every heap area. |
visitor | This function is called for every area in the heap (with block as NULL). If visit_all_blocks is true, visitor is also called for every allocated block in every area (with block!=NULL ). return false from this function to stop visiting early. |
arg | Extra argument passed to visitor. |
Extended functionality. +More...
++Macros | |
#define | MI_SMALL_SIZE_MAX |
Maximum size allowed for small allocations in mi_malloc_small and mi_zalloc_small (usually 128*sizeof(void*) (= 1KB on 64-bit systems)) More... | |
+Typedefs | |
typedef void() | mi_deferred_free_fun(bool force, unsigned long long heartbeat) |
Type of deferred free functions. More... | |
+Functions | |
void * | mi_malloc_small (size_t size) |
Allocate a small object. More... | |
void * | mi_zalloc_small (size_t size) |
Allocate a zero initialized small object. More... | |
size_t | mi_usable_size (void *p) |
Return the available bytes in a memory block. More... | |
size_t | mi_good_size (size_t size) |
Return the used allocation size. More... | |
void | mi_collect (bool force) |
Eagerly free memory. More... | |
void | mi_stats_print (FILE *out) |
Print statistics. More... | |
void | mi_stats_reset () |
Reset statistics. More... | |
void | mi_thread_init () |
Initialize mimalloc on a thread. More... | |
void | mi_thread_done () |
Uninitialize mimalloc on a thread. More... | |
void | mi_thread_stats_print (FILE *out) |
Print out heap statistics for this thread. More... | |
void | mi_register_deferred_free (mi_deferred_free_fun *deferred_free) |
Register a deferred free function. More... | |
Extended functionality.
+#define MI_SMALL_SIZE_MAX | +
Maximum size allowed for small allocations in mi_malloc_small and mi_zalloc_small (usually 128*sizeof(void*)
(= 1KB on 64-bit systems))
typedef void() mi_deferred_free_fun(bool force, unsigned long long heartbeat) | +
Type of deferred free functions.
+force | If true all outstanding items should be freed. |
heartbeat | A monotonically increasing count. |
void mi_collect | +( | +bool | +force | ) | ++ |
Eagerly free memory.
+force | If true, aggressively return memory to the OS (can be expensive!) |
Regular code should not have to call this function. It can be beneficial in very narrow circumstances; in particular, when a long running thread allocates a lot of blocks that are freed by other threads it may improve resource usage by calling this every once in a while.
+ +size_t mi_good_size | +( | +size_t | +size | ) | ++ |
Return the used allocation size.
+size | The minimal required size in bytes. |
n
that will be allocated, where n >= size
.Generally, mi_usable_size(mi_malloc(size)) == mi_good_size(size)
. This can be used to reduce internal wasted space when allocating buffers for example.
void* mi_malloc_small | +( | +size_t | +size | ) | ++ |
Allocate a small object.
+size | The size in bytes, can be at most MI_SMALL_SIZE_MAX. |
void mi_register_deferred_free | +( | +mi_deferred_free_fun * | +deferred_free | ) | ++ |
Register a deferred free function.
+deferred_free | Address of a deferred free-ing function or NULL to unregister. |
Some runtime systems use deferred free-ing, for example when using reference counting to limit the worst case free time. Such systems can register (re-entrant) deferred free function to free more memory on demand. When the force parameter is true all possible memory should be freed. The per-thread heartbeat parameter is monotonically increasing and guaranteed to be deterministic if the program allocates deterministically. The deferred_free function is guaranteed to be called deterministically after some number of allocations (regardless of freeing or available free memory). At most one deferred_free function can be active.
+ +void mi_stats_print | +( | +FILE * | +out | ) | ++ |
Print statistics.
+out | Output file. Use NULL for stderr. |
Most detailed when using a debug build.
+ +void mi_stats_reset | +( | +) | ++ |
Reset statistics.
+ +void mi_thread_done | +( | +) | ++ |
Uninitialize mimalloc on a thread.
+Should not be used as on most systems (pthreads, windows) this is done automatically. Ensures that any memory that is not freed yet (but will be freed by other threads in the future) is properly handled.
+ +void mi_thread_init | +( | +) | ++ |
Initialize mimalloc on a thread.
+Should not be used as on most systems (pthreads, windows) this is done automatically.
+ +void mi_thread_stats_print | +( | +FILE * | +out | ) | ++ |
Print out heap statistics for this thread.
+out | Output file. Use NULL for stderr. |
Most detailed when using a debug build.
+ +size_t mi_usable_size | +( | +void * | +p | ) | ++ |
Return the available bytes in a memory block.
+p | Pointer to previously allocated memory (or NULL) |
The returned size can be used to call mi_expand successfully. The returned size is always at least equal to the allocated size of p, and, in the current design, should be less than 16.7% more.
+void* mi_zalloc_small | +( | +size_t | +size | ) | ++ |
Allocate a zero initialized small object.
+size | The size in bytes, can be at most MI_SMALL_SIZE_MAX. |
First-class heaps that can be destroyed in one go. +More...
++Typedefs | |
typedef struct mi_heap_s | mi_heap_t |
Type of first-class heaps. More... | |
+Functions | |
mi_heap_t * | mi_heap_new () |
Create a new heap that can be used for allocation. More... | |
void | mi_heap_delete (mi_heap_t *heap) |
Delete a previously allocated heap. More... | |
void | mi_heap_destroy (mi_heap_t *heap) |
Destroy a heap, freeing all its still allocated blocks. More... | |
mi_heap_t * | mi_heap_set_default (mi_heap_t *heap) |
Set the default heap to use for mi_malloc() et al. More... | |
mi_heap_t * | mi_heap_get_default () |
Get the default heap that is used for mi_malloc() et al. More... | |
mi_heap_t * | mi_heap_get_backing () |
Get the backing heap. More... | |
void * | mi_heap_malloc (mi_heap_t *heap, size_t size) |
Allocate in a specific heap. More... | |
void * | mi_heap_zalloc (mi_heap_t *heap, size_t size) |
Allocate zero-initialized in a specific heap. More... | |
void * | mi_heap_calloc (mi_heap_t *heap, size_t count, size_t size) |
Allocate count zero-initialized elements in a specific heap. More... | |
void * | mi_heap_mallocn (mi_heap_t *heap, size_t count, size_t size) |
Allocate count elements in a specific heap. More... | |
char * | mi_heap_strdup (mi_heap_t *heap, const char *s) |
Duplicate a string in a specific heap. More... | |
char * | mi_heap_strndup (mi_heap_t *heap, const char *s, size_t n) |
Duplicate a string of at most length n in a specific heap. More... | |
char * | mi_heap_realpath (mi_heap_t *heap, const char *fname, char *resolved_name) |
Resolve a file path name using a specific heap to allocate the result. More... | |
First-class heaps that can be destroyed in one go.
+typedef struct mi_heap_s mi_heap_t | +
Type of first-class heaps.
+A heap can only be used for (re)allocation in the thread that created this heap! Any allocated blocks can be freed by any other thread though.
+ +void* mi_heap_calloc | +( | +mi_heap_t * | +heap, | +
+ | + | size_t | +count, | +
+ | + | size_t | +size | +
+ | ) | ++ |
Allocate count zero-initialized elements in a specific heap.
+void mi_heap_delete | +( | +mi_heap_t * | +heap | ) | ++ |
Delete a previously allocated heap.
+This will release resources and migrate any still allocated blocks in this heap (efficienty) to the default heap.
+If heap is the default heap, the default heap is set to the backing heap.
+ +void mi_heap_destroy | +( | +mi_heap_t * | +heap | ) | ++ |
Destroy a heap, freeing all its still allocated blocks.
+Use with care as this will free all blocks still allocated in the heap. However, this can be a very efficient way to free all heap memory in one go.
+If heap is the default heap, the default heap is set to the backing heap.
+ +mi_heap_t* mi_heap_get_backing | +( | +) | ++ |
Get the backing heap.
+The backing heap is the initial default heap for a thread and always available for allocations. It cannot be destroyed or deleted except by exiting the thread.
+ +mi_heap_t* mi_heap_get_default | +( | +) | ++ |
Get the default heap that is used for mi_malloc() et al.
+void* mi_heap_malloc | +( | +mi_heap_t * | +heap, | +
+ | + | size_t | +size | +
+ | ) | ++ |
Allocate in a specific heap.
+void* mi_heap_mallocn | +( | +mi_heap_t * | +heap, | +
+ | + | size_t | +count, | +
+ | + | size_t | +size | +
+ | ) | ++ |
Allocate count elements in a specific heap.
+mi_heap_t* mi_heap_new | +( | +) | ++ |
Create a new heap that can be used for allocation.
+ +char* mi_heap_realpath | +( | +mi_heap_t * | +heap, | +
+ | + | const char * | +fname, | +
+ | + | char * | +resolved_name | +
+ | ) | ++ |
Resolve a file path name using a specific heap to allocate the result.
+Set the default heap to use for mi_malloc() et al.
+heap | The new default heap. |
char* mi_heap_strdup | +( | +mi_heap_t * | +heap, | +
+ | + | const char * | +s | +
+ | ) | ++ |
Duplicate a string in a specific heap.
+char* mi_heap_strndup | +( | +mi_heap_t * | +heap, | +
+ | + | const char * | +s, | +
+ | + | size_t | +n | +
+ | ) | ++ |
Duplicate a string of at most length n in a specific heap.
+void* mi_heap_zalloc | +( | +mi_heap_t * | +heap, | +
+ | + | size_t | +size | +
+ | ) | ++ |
Allocate zero-initialized in a specific heap.
+The basic allocation interface. +More...
++Functions | |
void | mi_free (void *p) |
Free previously allocated memory. More... | |
void * | mi_malloc (size_t size) |
Allocate size bytes. More... | |
void * | mi_zalloc (size_t size) |
Allocate zero-initialized size bytes. More... | |
void * | mi_calloc (size_t count, size_t size) |
Allocate zero-initialized count elements of size bytes. More... | |
void * | mi_realloc (void *p, size_t newsize) |
Re-allocate memory to newsize bytes. More... | |
void * | mi_rezalloc (void *p, size_t newsize) |
Reallocate memory to newsize bytes, with extra memory initialized to zero. More... | |
void * | mi_recalloc (void *p, size_t count, size_t size) |
Re-allocate memory to count elements of size bytes, with extra memory initialized to zero. More... | |
void * | mi_expand (void *p, size_t newsize) |
Try to re-allocate memory to newsize bytes in place. More... | |
void * | mi_mallocn (size_t count, size_t size) |
Allocate count elements of size bytes. More... | |
void * | mi_reallocn (void *p, size_t count, size_t size) |
Re-allocate memory to count elements of size bytes. More... | |
void * | mi_reallocf (void *p, size_t newsize) |
Re-allocate memory to newsize bytes,. More... | |
char * | mi_strdup (const char *s) |
Allocate and duplicate a string. More... | |
char * | mi_strndup (const char *s, size_t n) |
Allocate and duplicate a string up to n bytes. More... | |
char * | mi_realpath (const char *fname, char *resolved_name) |
Resolve a file path name. More... | |
The basic allocation interface.
+void* mi_calloc | +( | +size_t | +count, | +
+ | + | size_t | +size | +
+ | ) | ++ |
Allocate zero-initialized count elements of size bytes.
+count | number of elements. |
size | size of each element. |
count*size
overflows.Returns a unique pointer if called with either size or count of 0.
void* mi_expand | +( | +void * | +p, | +
+ | + | size_t | +newsize | +
+ | ) | ++ |
Try to re-allocate memory to newsize bytes in place.
+p | pointer to previously allocated memory (or NULL). |
newsize | the new required size in bytes. |
void mi_free | +( | +void * | +p | ) | ++ |
Free previously allocated memory.
+The pointer p
must have been allocated before (or be NULL).
p | pointer to free, or NULL. |
void* mi_malloc | +( | +size_t | +size | ) | ++ |
Allocate size bytes.
+size | number of bytes to allocate. |
void* mi_mallocn | +( | +size_t | +count, | +
+ | + | size_t | +size | +
+ | ) | ++ |
Allocate count elements of size bytes.
+count | The number of elements. |
size | The size of each element. |
If there is no overflow, it behaves exactly like mi_malloc(p,count*size)
.
void* mi_realloc | +( | +void * | +p, | +
+ | + | size_t | +newsize | +
+ | ) | ++ |
Re-allocate memory to newsize bytes.
+p | pointer to previously allocated memory (or NULL). |
newsize | the new required size in bytes. |
void* mi_reallocf | +( | +void * | +p, | +
+ | + | size_t | +newsize | +
+ | ) | ++ |
Re-allocate memory to newsize bytes,.
+p | pointer to previously allocated memory (or NULL). |
newsize | the new required size in bytes. |
In contrast to mi_realloc(), if NULL is returned, the original pointer p is freed (if it was not NULL itself). Otherwise the original pointer is either freed or returned as the reallocated result (in case it fits in-place with the new size). If the pointer p is NULL, it behaves as mi_malloc(newsize). If newsize is larger than the original size allocated for p, the bytes after size are uninitialized.
+void* mi_reallocn | +( | +void * | +p, | +
+ | + | size_t | +count, | +
+ | + | size_t | +size | +
+ | ) | ++ |
Re-allocate memory to count elements of size bytes.
+p | Pointer to a previously allocated block (or NULL). |
count | The number of elements. |
size | The size of each element. |
If there is no overflow, it behaves exactly like mi_realloc(p,count*size)
.
char* mi_realpath | +( | +const char * | +fname, | +
+ | + | char * | +resolved_name | +
+ | ) | ++ |
Resolve a file path name.
+fname | File name. |
resolved_name | Should be NULL (but can also point to a buffer of at least PATH_MAX bytes). |
If resolved_name was NULL, the returned result should be freed with mi_free().
+Replacement for the standard realpath() such that mi_free() can be used on the returned result (if resolved_name was NULL).
+ +void* mi_recalloc | +( | +void * | +p, | +
+ | + | size_t | +count, | +
+ | + | size_t | +size | +
+ | ) | ++ |
Re-allocate memory to count elements of size bytes, with extra memory initialized to zero.
+p | Pointer to a previously allocated block (or NULL). |
count | The number of elements. |
size | The size of each element. |
If there is no overflow, it behaves exactly like mi_rezalloc(p,count*size)
.
void* mi_rezalloc | +( | +void * | +p, | +
+ | + | size_t | +newsize | +
+ | ) | ++ |
Reallocate memory to newsize bytes, with extra memory initialized to zero.
+p | Pointer to a previously allocated block (or NULL). |
newsize | The new required size in bytes. |
If the newsize is larger than the original allocated size of p, the extra bytes are initialized to zero.
+ +char* mi_strdup | +( | +const char * | +s | ) | ++ |
Allocate and duplicate a string.
+s | string to duplicate (or NULL). |
Replacement for the standard strdup() such that mi_free() can be used on the returned result.
+ +char* mi_strndup | +( | +const char * | +s, | +
+ | + | size_t | +n | +
+ | ) | ++ |
Allocate and duplicate a string up to n bytes.
+s | string to duplicate (or NULL). |
n | maximum number of bytes to copy (excluding the terminating zero). |
Replacement for the standard strndup() such that mi_free() can be used on the returned result.
+ +void* mi_zalloc | +( | +size_t | +size | ) | ++ |
Allocate zero-initialized size
bytes.
size | The size in bytes. |
Set runtime behavior. +More...
++Enumerations | |
enum | mi_option_t { + mi_option_page_reset, +mi_option_cache_reset, +mi_option_pool_commit, +mi_option_show_stats, + + mi_option_show_errors, +mi_option_verbose, +_mi_option_last + + } |
Runtime options. More... | |
+Functions | |
bool | mi_option_enabled (mi_option_t option) |
void | mi_option_enable (mi_option_t option, bool enable) |
void | mi_option_enable_default (mi_option_t option, bool enable) |
long | mi_option_get (mi_option_t option) |
void | mi_option_set (mi_option_t option, long value) |
void | mi_option_set_default (mi_option_t option, long value) |
Set runtime behavior.
+enum mi_option_t | +
Runtime options.
+void mi_option_enable | +( | +mi_option_t | +option, | +
+ | + | bool | +enable | +
+ | ) | ++ |
void mi_option_enable_default | +( | +mi_option_t | +option, | +
+ | + | bool | +enable | +
+ | ) | ++ |
bool mi_option_enabled | +( | +mi_option_t | +option | ) | ++ |
long mi_option_get | +( | +mi_option_t | +option | ) | ++ |
void mi_option_set | +( | +mi_option_t | +option, | +
+ | + | long | +value | +
+ | ) | ++ |
void mi_option_set_default | +( | +mi_option_t | +option, | +
+ | + | long | +value | +
+ | ) | ++ |
Typed allocation macros. +More...
++Macros | |
#define | mi_malloc_tp(tp) |
Allocate a block of type tp. More... | |
#define | mi_zalloc_tp(tp) |
Allocate a zero-initialized block of type tp. More... | |
#define | mi_calloc_tp(tp, count) |
Allocate count zero-initialized blocks of type tp. More... | |
#define | mi_mallocn_tp(tp, count) |
Allocate count blocks of type tp. More... | |
#define | mi_reallocn_tp(p, tp, count) |
Re-allocate to count blocks of type tp. More... | |
#define | mi_recalloc_tp(p, tp, count) |
Re-allocate to count zero-initialized blocks of type tp. More... | |
#define | mi_heap_malloc_tp(hp, tp) |
Allocate a block of type tp in a heap hp. More... | |
#define | mi_heap_zalloc_tp(hp, tp) |
Allocate a zero-initialized block of type tp in a heap hp. More... | |
#define | mi_heap_calloc_tp(hp, tp, count) |
Allocate count zero-initialized blocks of type tp in a heap hp. More... | |
#define | mi_heap_mallocn_tp(hp, tp, count) |
Allocate count blocks of type tp in a heap hp. More... | |
Typed allocation macros.
+#define mi_calloc_tp | +( | ++ | tp, | +
+ | + | + | count | +
+ | ) | ++ |
Allocate count zero-initialized blocks of type tp.
+ +#define mi_heap_calloc_tp | +( | ++ | hp, | +
+ | + | + | tp, | +
+ | + | + | count | +
+ | ) | ++ |
Allocate count zero-initialized blocks of type tp in a heap hp.
+ +#define mi_heap_malloc_tp | +( | ++ | hp, | +
+ | + | + | tp | +
+ | ) | ++ |
Allocate a block of type tp in a heap hp.
+ +#define mi_heap_mallocn_tp | +( | ++ | hp, | +
+ | + | + | tp, | +
+ | + | + | count | +
+ | ) | ++ |
Allocate count blocks of type tp in a heap hp.
+ +#define mi_heap_zalloc_tp | +( | ++ | hp, | +
+ | + | + | tp | +
+ | ) | ++ |
Allocate a zero-initialized block of type tp in a heap hp.
+ +#define mi_malloc_tp | +( | ++ | tp | ) | ++ |
Allocate a block of type tp.
+tp | The type of the block to allocate. |
Example:
#define mi_mallocn_tp | +( | ++ | tp, | +
+ | + | + | count | +
+ | ) | ++ |
Allocate count blocks of type tp.
+ +#define mi_reallocn_tp | +( | ++ | p, | +
+ | + | + | tp, | +
+ | + | + | count | +
+ | ) | ++ |
Re-allocate to count blocks of type tp.
+ +#define mi_recalloc_tp | +( | ++ | p, | +
+ | + | + | tp, | +
+ | + | + | count | +
+ | ) | ++ |
Re-allocate to count zero-initialized blocks of type tp.
+ +#define mi_zalloc_tp | +( | ++ | tp | ) | ++ |
Allocate a zero-initialized block of type tp.
+ +t |