Skip to content

Commit 41d2996

Browse files
committed
Add posix_memalign-support.
1 parent 1552d4f commit 41d2996

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

libmimalloc-sys/src/extended.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,12 @@ extern "C" {
104104
/// This is a [`mi_zalloc`](crate::mi_zalloc) equivalent of [`mi_malloc_aligned_at`].
105105
pub fn mi_zalloc_aligned_at(size: usize, alignment: usize, offset: usize) -> *mut c_void;
106106

107+
/// Allocate `size` of bytes aligned by `alignment` and place the address of the
108+
/// allocated memory to `ptr`.
109+
///
110+
/// Returns zero on success, invalid argument for invalid alignment, or out-of-memory.
111+
pub fn mi_posix_memalign(ptr: *mut *mut c_void, alignment: usize, size: usize) -> c_int;
112+
107113
/// Allocate `size * count` bytes aligned by `alignment` at a specified
108114
/// `offset`, zero-initialized.
109115
///

0 commit comments

Comments
 (0)