Skip to content

Conversation

pub fn mi_malloc_aligned(size: usize, alignment: usize) -> *const c_void;
pub fn mi_realloc_aligned(p: *const c_void, size: usize, alignment: usize) -> *const c_void;
pub fn mi_free(p: *const c_void) -> c_void;
pub fn mi_usable_size(p: *mut c_void) -> usize;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically it's size_t, but I wanted to avoid dependency on libc.
Practically, it should be usize https://github.com/rust-lang/libc/search?q=pub+type+size_t+%3D&unscoped_q=pub+type+size_t+%3D

@ordian ordian changed the title libmimalloc-sys: expose mit_usable_size libmimalloc-sys: expose mi_usable_size Mar 11, 2020
Copy link
Collaborator

@octavonce octavonce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great!

@octavonce octavonce merged commit 8036c7b into purpleprotocol:master Mar 12, 2020
@ordian ordian deleted the usable_size branch March 12, 2020 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants