mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-01 17:24:38 +03:00
merge from dev
This commit is contained in:
commit
550b628358
1 changed files with 3 additions and 4 deletions
7
src/os.c
7
src/os.c
|
@ -368,8 +368,7 @@ void* _mi_os_alloc_aligned(size_t size, size_t alignment, bool commit, bool allo
|
||||||
if (p != NULL) {
|
if (p != NULL) {
|
||||||
*memid = _mi_memid_create_os(p, size, commit, os_is_zero, os_is_large);
|
*memid = _mi_memid_create_os(p, size, commit, os_is_zero, os_is_large);
|
||||||
memid->mem.os.base = os_base;
|
memid->mem.os.base = os_base;
|
||||||
// memid->mem.os.alignment = alignment;
|
memid->mem.os.size += ((uint8_t*)p - (uint8_t*)os_base); // todo: return from prim_alloc_aligned?
|
||||||
memid->mem.os.size += ((uint8_t*)p - (uint8_t*)os_base); // todo: return from prim_alloc_aligned
|
|
||||||
}
|
}
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
@ -640,7 +639,7 @@ void* _mi_os_alloc_huge_os_pages(size_t pages, int numa_node, mi_msecs_t max_mse
|
||||||
if (psize != NULL) *psize = 0;
|
if (psize != NULL) *psize = 0;
|
||||||
if (pages_reserved != NULL) *pages_reserved = 0;
|
if (pages_reserved != NULL) *pages_reserved = 0;
|
||||||
size_t size = 0;
|
size_t size = 0;
|
||||||
uint8_t* start = mi_os_claim_huge_pages(pages, &size);
|
uint8_t* const start = mi_os_claim_huge_pages(pages, &size);
|
||||||
if (start == NULL) return NULL; // or 32-bit systems
|
if (start == NULL) return NULL; // or 32-bit systems
|
||||||
|
|
||||||
// Allocate one page at the time but try to place them contiguously
|
// Allocate one page at the time but try to place them contiguously
|
||||||
|
@ -696,7 +695,7 @@ void* _mi_os_alloc_huge_os_pages(size_t pages, int numa_node, mi_msecs_t max_mse
|
||||||
if (psize != NULL) { *psize = page * MI_HUGE_OS_PAGE_SIZE; }
|
if (psize != NULL) { *psize = page * MI_HUGE_OS_PAGE_SIZE; }
|
||||||
if (page != 0) {
|
if (page != 0) {
|
||||||
mi_assert(start != NULL);
|
mi_assert(start != NULL);
|
||||||
*memid = _mi_memid_create_os(start, *psize, true /* is committed */, all_zero, true /* is_large */);
|
*memid = _mi_memid_create_os(start, size, true /* is committed */, all_zero, true /* is_large */);
|
||||||
memid->memkind = MI_MEM_OS_HUGE;
|
memid->memkind = MI_MEM_OS_HUGE;
|
||||||
mi_assert(memid->is_pinned);
|
mi_assert(memid->is_pinned);
|
||||||
#ifdef MI_TRACK_ASAN
|
#ifdef MI_TRACK_ASAN
|
||||||
|
|
Loading…
Add table
Reference in a new issue