Loading...
--- libmalloc/libmalloc-657.80.3/src/nano_malloc_common.h
+++ libmalloc/libmalloc-317.121.1/src/nano_malloc_common.h
@@ -24,20 +24,20 @@
#ifndef __NANO_MALLOC_COMMON_H
#define __NANO_MALLOC_COMMON_H
-#include <malloc/_ptrcheck.h>
-__ptrcheck_abi_assume_single()
+// Definitions that are common to Nano V1 and Nano V2.
+#if TARGET_OS_OSX || TARGET_OS_SIMULATOR || TARGET_OS_DRIVERKIT
+#define NANO_PREALLOCATE_BAND_VM 0
+#else // TARGET_OS_OSX || TARGET_OS_SIMULATOR || TARGET_OS_DRIVERKIT
+#define NANO_PREALLOCATE_BAND_VM 1 // pre-allocate reserved vm range
+#endif // TARGET_OS_OSX || TARGET_OS_SIMULATOR || TARGET_OS_DRIVERKIT
typedef enum {
NANO_NONE = 0,
+ NANO_V1 = 1,
NANO_V2 = 2,
} nano_version_t;
// Nano malloc enabled flag
-//
-// Note that this flag indicates whether a "nano-like" configuration, i.e. one
-// that trades memory for CPU and scalability, is enabled, but not literally
-// whether the nano allocator itself is engaged. Test for nano itself using
-// initial_nano_zone.
MALLOC_NOEXPORT
extern nano_version_t _malloc_engaged_nano;
@@ -46,11 +46,7 @@
extern unsigned int nano_common_max_magazines;
MALLOC_NOEXPORT
-extern bool nano_common_max_magazines_is_ncpu;
-
-// Index of last region to be allocated
-MALLOC_NOEXPORT
-extern unsigned int nano_max_region;
+extern boolean_t nano_common_max_magazines_is_ncpu;
MALLOC_NOEXPORT
void
@@ -58,7 +54,7 @@
MALLOC_NOEXPORT
void
-nano_common_init(const char * __null_terminated * __null_terminated envp, const char * __null_terminated * __null_terminated apple, const char *bootargs);
+nano_common_init(const char *envp[], const char *apple[], const char *bootargs);
MALLOC_NOEXPORT
void
@@ -70,16 +66,8 @@
unsigned debug_flags, int vm_page_label, void *base_addr);
MALLOC_NOEXPORT
-bool
+boolean_t
nano_common_allocate_vm_space(mach_vm_address_t base, mach_vm_size_t size);
-
-MALLOC_NOEXPORT
-bool
-nano_common_reserve_vm_space(mach_vm_address_t base, mach_vm_size_t size);
-
-MALLOC_NOEXPORT
-bool
-nano_common_unprotect_vm_space(mach_vm_address_t base, mach_vm_size_t size);
MALLOC_NOEXPORT
void
@@ -90,9 +78,5 @@
nano_common_default_reader(task_t task, vm_address_t address, vm_size_t size,
void **ptr);
-MALLOC_NOEXPORT
-nano_version_t
-_nano_common_init_pick_mode(const char * __null_terminated * __null_terminated envp, const char * __null_terminated * __null_terminated apple, const char *bootargs, bool space_efficient_enabled);
-
#endif // __NANO_MALLOC_COMMON_H