about summary refs log tree commit diff
path: root/utils
diff options
context:
space:
mode:
authorDavid Carlier <devnexen@gmail.com>2022-06-02 21:48:15 +0100
committerDavid Carlier <devnexen@gmail.com>2022-06-02 21:48:15 +0100
commit6afccdebcd8b771c1b8eed2bd71d7b81985a9c83 (patch)
treed9d9ec6ff631fc8b6915cb0ffd5d89d49a7a9d89 /utils
parent741331649685345abf9b1c13e7a7f8712c2d3e76 (diff)
downloadafl++-6afccdebcd8b771c1b8eed2bd71d7b81985a9c83.tar.gz
libdislocator, introduces malloc_good_size for Darwin.
Diffstat (limited to 'utils')
-rw-r--r--utils/libdislocator/libdislocator.so.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/utils/libdislocator/libdislocator.so.c b/utils/libdislocator/libdislocator.so.c
index 1b4a7316..fecf3bc6 100644
--- a/utils/libdislocator/libdislocator.so.c
+++ b/utils/libdislocator/libdislocator.so.c
@@ -520,6 +520,14 @@ size_t malloc_usable_size(const void *ptr) {
 
 }
 
+#if defined(__APPLE__)
+size_t malloc_good_size(size_t len) {
+
+  return (len & ~(ALLOC_ALIGN_SIZE - 1)) + ALLOC_ALIGN_SIZE;
+
+}
+#endif
+
 __attribute__((constructor)) void __dislocator_init(void) {
 
   char *tmp = getenv("AFL_LD_LIMIT_MB");