[][src]Crate rpmalloc_sys

🐏 rpmalloc-sys

Build Status Crates.io Docs Contributor Covenant Embark

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

c_void

Equivalent to C's void type when used as a pointer.

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_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

Type Definitions

c_int
c_uint
size_t