Merge pull request #1431 from devnexen/malloc_good_size_apple_libdislocator

libdislocator, introduces malloc_good_size for Darwin.
This commit is contained in:
van Hauser 2022-06-03 06:55:10 +02:00 committed by GitHub
commit 59bb4a6cc4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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");