Expand description
§🐏 rpmalloc-sys
Unsafe FFI bindings to rpmalloc C library
§Contributing
We welcome community contributions to this project.
Please read our Contributor Guide for more information on how to get started.
§License
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Note that the rpmalloc library this crate uses is under public domain, and can also be licensed under MIT.
§Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Structs§
- rpmalloc_
global_ statistics_ t - Global memory statistics
- rpmalloc_
thread_ size_ statistics_ t - Memory size statistics for a thread
- rpmalloc_
thread_ span_ statistics_ t - Mmemory span statistics for a thread
- rpmalloc_
thread_ statistics_ t - Memory statistics for a thread
Enums§
Functions§
- rpaligned_
alloc ⚠ - Allocate a memory block of at least the given size and alignment. Alignment must be a power of two and a multiple of sizeof(void*), and should ideally be less than memory page size. A caveat of rpmalloc internals is that this must also be strictly less than the span size (default 64KiB)
- rpaligned_
calloc ⚠ - Allocate a memory block of at least the given size and alignment, and zero initialize it. Alignment must be a power of two and a multiple of sizeof(void*), and should ideally be less than memory page size. A caveat of rpmalloc internals is that this must also be strictly less than the span size (default 64KiB)
- rpaligned_
realloc ⚠ - Reallocate the given block to at least the given size and alignment, with optional control flags (see RPMALLOC_NO_PRESERVE). Alignment must be a power of two and a multiple of sizeof(void*), and should ideally be less than memory page size. A caveat of rpmalloc internals is that this must also be strictly less than the span size (default 64KiB)
- rpcalloc⚠
- Allocate a memory block of at least the given size and zero initialize it
- rpfree⚠
- Free the given memory block
- rpmalloc⚠
- Allocate a memory block of at least the given size
- rpmalloc_
dump_ ⚠statistics - Dump all statistics in human readable format to file (should be a FILE*)
- rpmalloc_
finalize ⚠ - Finalize allocator
- rpmalloc_
global_ ⚠statistics - Get global statistics
- rpmalloc_
initialize ⚠ - Initialize allocator with default configuration
- rpmalloc_
is_ ⚠thread_ initialized - Query if allocator is initialized for calling thread
- rpmalloc_
thread_ ⚠collect - Perform deferred deallocations pending for the calling thread hea
- rpmalloc_
thread_ ⚠finalize - Finalize allocator for calling thread
- rpmalloc_
thread_ ⚠initialize - Initialize allocator for calling thread
- rpmalloc_
thread_ ⚠statistics - Get per-thread statistics
- rpmalloc_
usable_ ⚠size - Query the usable size of the given memory block (from given pointer to the end of block)
- rpmemalign⚠
- Allocate a memory block of at least the given size and alignment. Alignment must be a power of two and a multiple of sizeof(void*), and should ideally be less than memory page size. A caveat of rpmalloc internals is that this must also be strictly less than the span size (default 64KiB)
- rpposix_
memalign ⚠ - Allocate a memory block of at least the given size and alignment. Alignment must be a power of two and a multiple of sizeof(void*), and should ideally be less than memory page size. A caveat of rpmalloc internals is that this must also be strictly less than the span size (default 64KiB)
- rprealloc⚠
- Reallocate the given block to at least the given size