| From 852fb6df031560c5e353b497222b76394190e27d Mon Sep 17 00:00:00 2001 |
| From: Natale Patriciello <natale.patriciello@vonage.com> |
| Date: Thu, 18 Nov 2021 18:16:40 +0100 |
| Subject: [PATCH] Implement free_definite_size |
| |
| In Monterey, it seems that free_definite_size is required (despite |
| the documentation saying that is optional). The implementation |
| just forward the call to free. |
| |
| Signed-off-by: Natale Patriciello <natale.patriciello@gmail.com> |
| --- |
| src/libc_override_osx.h | 6 +++++- |
| 1 file changed, 5 insertions(+), 1 deletion(-) |
| |
| diff --git a/src/libc_override_osx.h b/src/libc_override_osx.h |
| index 9d5d611..a4c1dde 100644 |
| --- a/src/libc_override_osx.h |
| +++ b/src/libc_override_osx.h |
| @@ -129,6 +129,10 @@ void mz_free(malloc_zone_t* zone, void* ptr) { |
| return tc_free(ptr); |
| } |
| |
| +void mz_free_definite_size(malloc_zone_t* zone, void *ptr, size_t size) { |
| + return tc_free(ptr); |
| +} |
| + |
| void* mz_realloc(malloc_zone_t* zone, void* ptr, size_t size) { |
| return tc_realloc(ptr, size); |
| } |
| @@ -272,7 +276,7 @@ static void ReplaceSystemAlloc() { |
| MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 |
| // Switch to version 6 on OSX 10.6 to support memalign. |
| tcmalloc_zone.version = 6; |
| - tcmalloc_zone.free_definite_size = NULL; |
| + tcmalloc_zone.free_definite_size = &mz_free_definite_size; |
| tcmalloc_zone.memalign = &mz_memalign; |
| tcmalloc_introspection.zone_locked = &mi_zone_locked; |
| |
| -- |
| 2.30.2 |
| |