mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-02 09:44:37 +03:00
fix g++ compilation on macos
This commit is contained in:
parent
4b63c76861
commit
deda8bd22b
1 changed files with 10 additions and 5 deletions
|
@ -200,6 +200,9 @@ static malloc_introspection_t mi_introspect = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static malloc_zone_t mi_malloc_zone = {
|
static malloc_zone_t mi_malloc_zone = {
|
||||||
|
// note: even with designators, the order is important for C++ compilation
|
||||||
|
//.reserved1 = NULL,
|
||||||
|
//.reserved2 = NULL,
|
||||||
.size = &zone_size,
|
.size = &zone_size,
|
||||||
.malloc = &zone_malloc,
|
.malloc = &zone_malloc,
|
||||||
.calloc = &zone_calloc,
|
.calloc = &zone_calloc,
|
||||||
|
@ -212,18 +215,20 @@ static malloc_zone_t mi_malloc_zone = {
|
||||||
.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
|
||||||
|
#if defined(MAC_OS_X_VERSION_10_7) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7)
|
||||||
|
.version = 10,
|
||||||
|
#else
|
||||||
|
.version = 9,
|
||||||
|
#endif
|
||||||
// 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_7) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7)
|
||||||
.claimed_address = &zone_claimed_address,
|
.claimed_address = &zone_claimed_address,
|
||||||
.version = 10
|
|
||||||
#else
|
|
||||||
.version = 9
|
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
.version = 4
|
.version = 4,
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue