Merge branch 'dev' into dev-slice
This commit is contained in:
commit
2a4a3dfa23
@ -97,8 +97,8 @@ if(MI_OVERRIDE)
|
|||||||
message(STATUS " WARNING: interpose usually also needs zone overriding (use -DMI_OSX_INTERPOSE=ON)")
|
message(STATUS " WARNING: interpose usually also needs zone overriding (use -DMI_OSX_INTERPOSE=ON)")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
if((NOT MI_USE_CXX) AND MI_OVERRIDE)
|
if(MI_USE_CXX AND MI_OSX_INTERPOSE)
|
||||||
message(STATUS " WARNING: if overriding C++ new/delete, it is best to build mimalloc with a C++ compiler (use -DMI_USE_CXX=ON)")
|
message(STATUS " WARNING: if dynamically overriding malloc/free, it is more reliable to build mimalloc as C code (use -DMI_USE_CXX=OFF)")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
@ -64,7 +64,7 @@ static void* zone_valloc(malloc_zone_t* zone, size_t size) {
|
|||||||
|
|
||||||
static void zone_free(malloc_zone_t* zone, void* p) {
|
static void zone_free(malloc_zone_t* zone, void* p) {
|
||||||
MI_UNUSED(zone);
|
MI_UNUSED(zone);
|
||||||
mi_free(p);
|
mi_cfree(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void* zone_realloc(malloc_zone_t* zone, void* p, size_t newsize) {
|
static void* zone_realloc(malloc_zone_t* zone, void* p, size_t newsize) {
|
||||||
@ -373,7 +373,7 @@ __attribute__((used)) static const struct mi_interpose_s _mi_zone_interposes[]
|
|||||||
MI_INTERPOSE_MI(_malloc_fork_child),
|
MI_INTERPOSE_MI(_malloc_fork_child),
|
||||||
MI_INTERPOSE_MI(_malloc_fork_parent),
|
MI_INTERPOSE_MI(_malloc_fork_parent),
|
||||||
MI_INTERPOSE_MI(_malloc_fork_prepare),
|
MI_INTERPOSE_MI(_malloc_fork_prepare),
|
||||||
|
|
||||||
MI_INTERPOSE_ZONE(zone_batch_free),
|
MI_INTERPOSE_ZONE(zone_batch_free),
|
||||||
MI_INTERPOSE_ZONE(zone_batch_malloc),
|
MI_INTERPOSE_ZONE(zone_batch_malloc),
|
||||||
MI_INTERPOSE_ZONE(zone_calloc),
|
MI_INTERPOSE_ZONE(zone_calloc),
|
||||||
|
@ -94,15 +94,18 @@ typedef struct mi_nothrow_s { int _tag; } mi_nothrow_t;
|
|||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
void _ZdlPv(void* p); // delete
|
#endif
|
||||||
void _ZdaPv(void* p); // delete[]
|
void _ZdlPv(void* p); // delete
|
||||||
void _ZdlPvm(void* p, size_t n); // delete
|
void _ZdaPv(void* p); // delete[]
|
||||||
void _ZdaPvm(void* p, size_t n); // delete[]
|
void _ZdlPvm(void* p, size_t n); // delete
|
||||||
void* _Znwm(size_t n); // new
|
void _ZdaPvm(void* p, size_t n); // delete[]
|
||||||
void* _Znam(size_t n); // new[]
|
void* _Znwm(size_t n); // new
|
||||||
void* _ZnwmRKSt9nothrow_t(size_t n, mi_nothrow_t tag); // new nothrow
|
void* _Znam(size_t n); // new[]
|
||||||
void* _ZnamRKSt9nothrow_t(size_t n, mi_nothrow_t tag); // new[] nothrow
|
void* _ZnwmRKSt9nothrow_t(size_t n, mi_nothrow_t tag); // new nothrow
|
||||||
}
|
void* _ZnamRKSt9nothrow_t(size_t n, mi_nothrow_t tag); // new[] nothrow
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
__attribute__((used)) static struct mi_interpose_s _mi_cxx_interposes[] __attribute__((section("__DATA, __interpose"))) =
|
__attribute__((used)) static struct mi_interpose_s _mi_cxx_interposes[] __attribute__((section("__DATA, __interpose"))) =
|
||||||
{
|
{
|
||||||
MI_INTERPOSE_FUN(_ZdlPv,mi_free),
|
MI_INTERPOSE_FUN(_ZdlPv,mi_free),
|
||||||
@ -114,7 +117,6 @@ typedef struct mi_nothrow_s { int _tag; } mi_nothrow_t;
|
|||||||
MI_INTERPOSE_FUN(_ZnwmRKSt9nothrow_t,mi_new_nothrow),
|
MI_INTERPOSE_FUN(_ZnwmRKSt9nothrow_t,mi_new_nothrow),
|
||||||
MI_INTERPOSE_FUN(_ZnamRKSt9nothrow_t,mi_new_nothrow),
|
MI_INTERPOSE_FUN(_ZnamRKSt9nothrow_t,mi_new_nothrow),
|
||||||
};
|
};
|
||||||
#endif // __cplusplus
|
|
||||||
|
|
||||||
#elif defined(_MSC_VER)
|
#elif defined(_MSC_VER)
|
||||||
// cannot override malloc unless using a dll.
|
// cannot override malloc unless using a dll.
|
||||||
|
Loading…
Reference in New Issue
Block a user