mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-06 11:34:38 +03:00
refine mi_os_good_alloc_size and use it for huge pages (to ensure realloc is bounded as in #153
This commit is contained in:
parent
d278c26c0e
commit
1909cfb346
4 changed files with 18 additions and 12 deletions
|
@ -43,6 +43,7 @@ size_t _mi_os_page_size(void);
|
|||
void _mi_os_init(void); // called from process init
|
||||
void* _mi_os_alloc(size_t size, mi_stats_t* stats); // to allocate thread local data
|
||||
void _mi_os_free(void* p, size_t size, mi_stats_t* stats); // to free thread local data
|
||||
size_t _mi_os_good_alloc_size(size_t size);
|
||||
|
||||
// memory.c
|
||||
void* _mi_mem_alloc_aligned(size_t size, size_t alignment, bool* commit, bool* large, bool* is_zero, size_t* id, mi_os_tld_t* tld);
|
||||
|
|
|
@ -68,6 +68,9 @@ terms of the MIT license. A copy of the license can be found in the file
|
|||
|
||||
#define MI_INTPTR_SIZE (1<<MI_INTPTR_SHIFT)
|
||||
|
||||
#define KiB ((size_t)1024)
|
||||
#define MiB (KiB*KiB)
|
||||
#define GiB (MiB*KiB)
|
||||
|
||||
// ------------------------------------------------------
|
||||
// Main internal data-structures
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue