summaryrefslogtreecommitdiff
path: root/src/alloc-override.c
diff options
context:
space:
mode:
authordaan <daan@microsoft.com>2020-02-02 21:03:09 -0800
committerdaan <daan@microsoft.com>2020-02-02 21:03:09 -0800
commitf3c47c7c91801c712db08d6944503132defef039 (patch)
treec6a714ad0f269e429a544a5b8c60c904b66af14e /src/alloc-override.c
parent757dcc84115eeccb93ff23e177851c6d0d88f8ea (diff)
improved malloc zone handling on macOSX (not working yet)
Diffstat (limited to 'src/alloc-override.c')
-rw-r--r--src/alloc-override.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/alloc-override.c b/src/alloc-override.c
index c0fdf16..151c233 100644
--- a/src/alloc-override.c
+++ b/src/alloc-override.c
@@ -13,7 +13,7 @@ terms of the MIT license. A copy of the license can be found in the file
#error "It is only possible to override "malloc" on Windows when building as a DLL (and linking the C runtime as a DLL)"
#endif
-#if defined(MI_MALLOC_OVERRIDE) && !defined(_WIN32)
+#if defined(MI_MALLOC_OVERRIDE) && !(defined(_WIN32) || (defined(__MACH__) && !defined(MI_INTERPOSE)))
// ------------------------------------------------------
// Override system malloc
@@ -68,10 +68,10 @@ terms of the MIT license. A copy of the license can be found in the file
// we just override new/delete which does work in a static library.
#else
// On all other systems forward to our API
- void* malloc(size_t size) mi_attr_noexcept MI_FORWARD1(mi_malloc, size);
- void* calloc(size_t size, size_t n) mi_attr_noexcept MI_FORWARD2(mi_calloc, size, n);
- void* realloc(void* p, size_t newsize) mi_attr_noexcept MI_FORWARD2(mi_realloc, p, newsize);
- void free(void* p) mi_attr_noexcept MI_FORWARD0(mi_free, p);
+ void* malloc(size_t size) MI_FORWARD1(mi_malloc, size);
+ void* calloc(size_t size, size_t n) MI_FORWARD2(mi_calloc, size, n);
+ void* realloc(void* p, size_t newsize) MI_FORWARD2(mi_realloc, p, newsize);
+ void free(void* p) MI_FORWARD0(mi_free, p);
#endif
#if (defined(__GNUC__) || defined(__clang__)) && !defined(__MACH__)
@@ -99,8 +99,8 @@ terms of the MIT license. A copy of the license can be found in the file
void* operator new[](std::size_t n, const std::nothrow_t& tag) noexcept { UNUSED(tag); return mi_new_nothrow(n); }
#if (__cplusplus >= 201402L || _MSC_VER >= 1916)
- void operator delete (void* p, std::size_t n) MI_FORWARD02(mi_free_size,p,n);
- void operator delete[](void* p, std::size_t n) MI_FORWARD02(mi_free_size,p,n);
+ void operator delete (void* p, std::size_t n) noexcept MI_FORWARD02(mi_free_size,p,n);
+ void operator delete[](void* p, std::size_t n) noexcept MI_FORWARD02(mi_free_size,p,n);
#endif
#if (__cplusplus > 201402L || defined(__cpp_aligned_new)) && (!defined(__GNUC__) || (__GNUC__ > 5))