#include <sys/types.h>
#include <sys/mman.h>
#include <mach/vm_param.h>
+#include <mach/mach_init.h>
+#include "stack_logging_internal.h"
/*
* Stub function to account for the differences in standard compliance
offset = ((uintptr_t) addr) & PAGE_MASK;
addr = (void *) (((uintptr_t) addr) & ~PAGE_MASK);
len += offset;
- return __munmap(addr, len);
-}
+ int result = __munmap(addr, len);
+
+ if (__syscall_logger) {
+ __syscall_logger(stack_logging_type_vm_deallocate, (uintptr_t)mach_task_self(), (uintptr_t)addr, len, 0, 0);
+ }
+
+ return result;
+}
#endif /* NO_SYSCALL_LEGACY */