about summary refs log tree commit diff
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2022-06-03 06:55:10 +0200
committerGitHub <noreply@github.com>2022-06-03 06:55:10 +0200
commit59bb4a6cc4ddbcced6de275ba847994d90c70a74 (patch)
treed9d9ec6ff631fc8b6915cb0ffd5d89d49a7a9d89
parent741331649685345abf9b1c13e7a7f8712c2d3e76 (diff)
parent6afccdebcd8b771c1b8eed2bd71d7b81985a9c83 (diff)
downloadafl++-59bb4a6cc4ddbcced6de275ba847994d90c70a74.tar.gz
Merge pull request #1431 from devnexen/malloc_good_size_apple_libdislocator
libdislocator, introduces malloc_good_size for Darwin.
-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");