mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-08-25 00:34:48 +03:00
add address hint to primitive allocation API
This commit is contained in:
parent
b27d154ffd
commit
0e76fe3798
8 changed files with 29 additions and 23 deletions
|
@ -71,8 +71,8 @@ int _mi_prim_free(void* addr, size_t size) {
|
|||
extern void* emmalloc_memalign(size_t alignment, size_t size);
|
||||
|
||||
// Note: the `try_alignment` is just a hint and the returned pointer is not guaranteed to be aligned.
|
||||
int _mi_prim_alloc(size_t size, size_t try_alignment, bool commit, bool allow_large, bool* is_large, bool* is_zero, void** addr) {
|
||||
MI_UNUSED(try_alignment); MI_UNUSED(allow_large); MI_UNUSED(commit);
|
||||
int _mi_prim_alloc(void* hint_addr, size_t size, size_t try_alignment, bool commit, bool allow_large, bool* is_large, bool* is_zero, void** addr) {
|
||||
MI_UNUSED(try_alignment); MI_UNUSED(allow_large); MI_UNUSED(commit); MI_UNUSED(hint_addr);
|
||||
*is_large = false;
|
||||
// TODO: Track the highest address ever seen; first uses of it are zeroes.
|
||||
// That assumes no one else uses sbrk but us (they could go up,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue