Skip to content

Commit c16b563

Browse files
authored
Merge pull request #54 from jq-rs/mi_aligned_alloc_support
Support for mi_aligned_alloc.
2 parents e157459 + 9e6fb61 commit c16b563

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
@@ -110,6 +110,12 @@ extern "C" {
110110
/// Returns zero on success, invalid argument for invalid alignment, or out-of-memory.
111111
pub fn mi_posix_memalign(ptr: *mut *mut c_void, alignment: usize, size: usize) -> c_int;
112112

113+
/// Allocate `size` bytes aligned by `alignment` with alignment as the first
114+
/// parameter.
115+
///
116+
/// Return pointer to the allocated memory or null if out of memory.
117+
pub fn mi_aligned_alloc(alignment: usize, size: usize) -> *mut c_void;
118+
113119
/// Allocate `size * count` bytes aligned by `alignment` at a specified
114120
/// `offset`, zero-initialized.
115121
///

0 commit comments

Comments
 (0)