diff options
author | Natale Patriciello <natale.patriciello@vonage.com> | 2021-11-18 18:16:40 +0100 |
---|---|---|
committer | Aliaksey Kandratsenka <alkondratenko@gmail.com> | 2021-12-12 22:28:06 -0800 |
commit | 852fb6df031560c5e353b497222b76394190e27d (patch) | |
tree | 8274d38917c96f518494baa070ed478e800fbf74 | |
parent | c25941200ef4ce39d0774c1332ff7abfbeab7035 (diff) | |
download | gperftools-852fb6df031560c5e353b497222b76394190e27d.tar.gz |
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>
-rw-r--r-- | src/libc_override_osx.h | 6 |
1 files changed, 5 insertions, 1 deletions
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; |