mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-21 06:19:31 +03:00
macos: aligned_alloc function and claimed_address field not present
- aligned_alloc is not present on macos. comment to suppress warning. - claimed_address is not present until macos_10.14. add appropriate preprocessor guard around zone_claimed_address function and assignment.
This commit is contained in:
parent
910eb728a3
commit
ca64e30a6d
2 changed files with 8 additions and 4 deletions
|
@ -110,11 +110,13 @@ static void zone_free_definite_size(malloc_zone_t* zone, void* p, size_t size) {
|
||||||
zone_free(zone,p);
|
zone_free(zone,p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(MAC_OS_X_VERSION_10_14) && \
|
||||||
|
MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_14
|
||||||
static boolean_t zone_claimed_address(malloc_zone_t* zone, void* p) {
|
static boolean_t zone_claimed_address(malloc_zone_t* zone, void* p) {
|
||||||
MI_UNUSED(zone);
|
MI_UNUSED(zone);
|
||||||
return mi_is_in_heap_region(p);
|
return mi_is_in_heap_region(p);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* ------------------------------------------------------
|
/* ------------------------------------------------------
|
||||||
Introspection members
|
Introspection members
|
||||||
|
@ -211,12 +213,14 @@ static malloc_zone_t mi_malloc_zone = {
|
||||||
.batch_malloc = &zone_batch_malloc,
|
.batch_malloc = &zone_batch_malloc,
|
||||||
.batch_free = &zone_batch_free,
|
.batch_free = &zone_batch_free,
|
||||||
.introspect = &mi_introspect,
|
.introspect = &mi_introspect,
|
||||||
#if defined(MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
|
#if defined(MAC_OS_X_VERSION_10_6) && \
|
||||||
|
MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
|
||||||
// switch to version 9+ on OSX 10.6 to support memalign.
|
// switch to version 9+ on OSX 10.6 to support memalign.
|
||||||
.memalign = &zone_memalign,
|
.memalign = &zone_memalign,
|
||||||
.free_definite_size = &zone_free_definite_size,
|
.free_definite_size = &zone_free_definite_size,
|
||||||
.pressure_relief = &zone_pressure_relief,
|
.pressure_relief = &zone_pressure_relief,
|
||||||
#if defined(MAC_OS_X_VERSION_10_7) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
|
#if defined(MAC_OS_X_VERSION_10_14) && \
|
||||||
|
MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_14
|
||||||
.claimed_address = &zone_claimed_address,
|
.claimed_address = &zone_claimed_address,
|
||||||
.version = 10
|
.version = 10
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -77,7 +77,7 @@ typedef struct mi_nothrow_s { int _tag; } mi_nothrow_t;
|
||||||
MI_INTERPOSE_MI(valloc),
|
MI_INTERPOSE_MI(valloc),
|
||||||
MI_INTERPOSE_MI(malloc_size),
|
MI_INTERPOSE_MI(malloc_size),
|
||||||
MI_INTERPOSE_MI(malloc_good_size),
|
MI_INTERPOSE_MI(malloc_good_size),
|
||||||
MI_INTERPOSE_MI(aligned_alloc),
|
//MI_INTERPOSE_MI(aligned_alloc),
|
||||||
#ifdef MI_OSX_ZONE
|
#ifdef MI_OSX_ZONE
|
||||||
// we interpose malloc_default_zone in alloc-override-osx.c so we can use mi_free safely
|
// we interpose malloc_default_zone in alloc-override-osx.c so we can use mi_free safely
|
||||||
MI_INTERPOSE_MI(free),
|
MI_INTERPOSE_MI(free),
|
||||||
|
|
Loading…
Add table
Reference in a new issue