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§
- Global memory statistics
- Memory size statistics for a thread
- Mmemory span statistics for a thread
- Memory statistics for a thread
Enums§
- Equivalent to C’s
void
type when used as a pointer.
Functions§
- 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)
- 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)
- 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)
- Allocate a memory block of at least the given size and zero initialize it
- Free the given memory block
- Allocate a memory block of at least the given size
- Dump all statistics in human readable format to file (should be a FILE*)
- Finalize allocator
- Get global statistics
- Initialize allocator with default configuration
- Query if allocator is initialized for calling thread
- Perform deferred deallocations pending for the calling thread hea
- Finalize allocator for calling thread
- Initialize allocator for calling thread
- Get per-thread statistics
- Query the usable size of the given memory block (from given pointer to the end of block)
- 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)
- 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)
- Reallocate the given block to at least the given size