Skip to content

Commit

Permalink
Implement free_definite_size
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
natale-p authored and alk committed Dec 13, 2021
1 parent c259412 commit 852fb6d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/libc_override_osx.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 852fb6d

Please sign in to comment.