Crate libmimalloc_sys[][src]

Structs

An area of heap space contains blocks of a single size.

Enums

First-class heaps that can be destroyed in one go.

Constants

The maximum number of bytes which may be used as an argument to a function in the _small family (mi_malloc_small, mi_zalloc_small, etc).

Option (experimental) specifying eagerly commit segments (4MiB) (enabled by default).

Option (experimental) specifying eagerly commit large (256MiB) memory regions (enabled by default, except on Windows).

Option (experimental) to use large OS pages (2MiB in size) if possible.

TODO: update later

Option (experimental) specifying OS tag to assign to mimalloc’d memory.

Option (experimental) to reset page memory after mi_option_reset_delay milliseconds when it becomes free.

Option (experimental) specifying number of huge OS pages (1GiB in size) to reserve at the start of the program.

TODO: update later

Option (experimental) specifying delay in milli-seconds before resetting a page (100ms by default).

Option (experimental) specifying number of segments per thread to keep cached.

Option allowing printing error messages to stderr.

Option allowing printing statistics to stderr when the program is done.

Option (experimental) to pretend there are at most N NUMA nodes.

Option allowing printing verbose messages to stderr.

Functions

Allocate size bytes aligned by alignment with alignment as the first parameter.

Allocate count items of size length each.

Allocate size * count bytes aligned by alignment.

Allocate size * count bytes aligned by alignment at a specified offset, zero-initialized.

Checked free: If p came from mimalloc’s heap (as decided by mi_is_in_heap_region), this is mi_free(p), but otherwise it is a no-op.

Check safely if any pointer is part of the default heap of this thread.

Eagerly free memory.

Try to re-allocate memory to newsize bytes in place.

Free previously allocated memory.

Alignment-aware deallocation: Like mi_free, but accepts the size and alignment as well.

Size-aware deallocation: Like mi_free, but accepts the size and alignment as well.

Layout-aware deallocation: Like mi_free, but accepts the size and alignment as well.

Return the used allocation size.

Equivalent to mi_calloc, but allocates out of the specific heap instead of the default.

Equivalent to mi_calloc_aligned, but allocates out of the specific heap instead of the default.

Equivalent to mi_calloc_aligned_at, but allocates out of the specific heap instead of the default.

Check safely if any pointer is part of a heap.

Release outstanding resources in a specific heap.

Does a heap contain a pointer to a previously allocated block?

Delete a previously allocated heap.

Destroy a heap, freeing all its still allocated blocks.

Get the backing heap.

Get the default heap that is used for mi_malloc et al.

Equivalent to mi_malloc, but allocates out of the specific heap instead of the default.

Equivalent to mi_malloc_aligned, but allocates out of the specific heap instead of the default.

Equivalent to mi_malloc_aligned_at, but allocates out of the specific heap instead of the default.

Equivalent to mi_malloc_small, but allocates out of the specific heap instead of the default.

Equivalent to mi_mallocn, but allocates out of the specific heap instead of the default.

Create a new heap that can be used for allocation.

Equivalent to mi_realloc, but allocates out of the specific heap instead of the default.

Equivalent to mi_realloc_aligned, but allocates out of the specific heap instead of the default.

Equivalent to mi_realloc_aligned_at, but allocates out of the specific heap instead of the default.

Equivalent to mi_reallocf, but allocates out of the specific heap instead of the default.

Equivalent to mi_reallocn, but allocates out of the specific heap instead of the default.

Equivalent to mi_realpath, but allocates out of the specific heap instead of the default.

Equivalent to mi_recalloc, but allocates out of the specific heap instead of the default.

Equivalent to mi_recalloc_aligned, but allocates out of the specific heap instead of the default.

Equivalent to mi_recalloc_aligned_at, but allocates out of the specific heap instead of the default.

Equivalent to mi_rezalloc, but allocates out of the specific heap instead of the default.

Equivalent to mi_rezalloc_aligned, but allocates out of the specific heap instead of the default.

Equivalent to mi_rezalloc_aligned_at, but allocates out of the specific heap instead of the default.

Set the default heap to use for mi_malloc et al.

Equivalent to mi_strdup, but allocates out of the specific heap instead of the default.

Equivalent to mi_strndup, but allocates out of the specific heap instead of the default.

Visit all areas and blocks in heap.

Equivalent to mi_zalloc, but allocates out of the specific heap instead of the default.

Equivalent to mi_zalloc_aligned, but allocates out of the specific heap instead of the default.

Equivalent to mi_zalloc_aligned_at, but allocates out of the specific heap instead of the default.

Returns true if this is a pointer into a memory region that has been reserved by the mimalloc heap.

Allocate size bytes.

Allocate size bytes aligned by alignment.

Allocate size bytes aligned by alignment at a specified offset.

Allocate an object of no more than MI_SMALL_SIZE_MAX bytes.

Allocate count items of size length each.

Returns the value of the provided option.

Returns true if the provided option is enabled.

Set the option to the given value.

If the given option has not yet been initialized with mi_option_set or mi_option_set_enabled, sets the option to the given value. If it has, this function does nothing.

Enable or disable the given option.

If the given option has not yet been initialized with mi_option_set or mi_option_set_enabled, enables or disables the option. If it has, this function does nothing.

Allocate size of bytes aligned by alignment and place the address of the allocated memory to ptr.

Return process information (time and memory usage). All parameters are optional (nullable) out-params:

Initialize the process.

Re-allocate memory to newsize bytes.

Re-allocate memory to newsize bytes, aligned by alignment.

Re-allocate memory to newsize bytes aligned by alignment at a specified offset.

Re-allocate memory to newsize bytes.

Re-allocate memory to count elements of size bytes.

Resolve a file path name, producing a C string which can be passed to mi_free.

Zero initialized re-allocation, following calloc paramater conventions.

Offset-aligned version of mi_recalloc.

Register a deferred free function.

Register an error callback function.

Register an output function.

Zero initialized re-allocation.

Offset-aligned version of mi_rezalloc.

Merge thread local statistics with the main statistics and reset.

Print the main statistics.

Print the main statistics.

Reset statistics.

Allocate and duplicate a nul-terminated C string.

Allocate and duplicate a nul-terminated C string, up to n bytes.

Uninitialize mimalloc on a thread.

Initialize mimalloc on a thread.

Print out heap statistics for this thread.

Return the available bytes in a memory block.

Return the mimalloc version number.

Allocate zero-initialized size bytes.

Allocate size bytes aligned by alignment, initialized to zero.

Allocate size bytes aligned by alignment at a specified offset, zero-initialized.

Allocate an zero-initialized object of no more than MI_SMALL_SIZE_MAX bytes.

Type Definitions

Visitor function passed to mi_heap_visit_blocks

Type of deferred free functions. Must be thread-safe.

Type of error callback functions. Must be thread-safe.

Runtime options. All options are false by default.

An output callback. Must be thread-safe.