Skip to content

Commit bcd1a38

Browse files
authored
Merge pull request #97 from devnexen/malloc_size
malloc hook for darwin malloc_usable_size equivalent
2 parents 5dc05d2 + 8f1e5b7 commit bcd1a38

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/malloc_hook.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,14 @@ EXTERNAL_API void *memalign(size_t alignment, size_t s) {
7979
EXTERNAL_API size_t malloc_usable_size(const void *ptr) {
8080
return iso_chunksz((void *) ptr);
8181
}
82+
#elif __APPLE__
83+
EXTERNAL_API size_t malloc_size(const void *ptr) {
84+
return iso_chunksz((void *) ptr);
85+
}
86+
87+
EXTERNAL_API size_t malloc_good_size(size_t size) {
88+
return ALIGN_SZ_UP(size);
89+
}
8290
#else
8391
EXTERNAL_API size_t malloc_usable_size(void *ptr) {
8492
return iso_chunksz(ptr);

0 commit comments

Comments
 (0)