nano_malloc_common.h [plain text]
#ifndef __NANO_MALLOC_COMMON_H
#define __NANO_MALLOC_COMMON_H
#if TARGET_OS_OSX || TARGET_OS_SIMULATOR
#define NANO_PREALLOCATE_BAND_VM 0
#else // TARGET_OS_OSX || TARGET_OS_SIMULATOR
#define NANO_PREALLOCATE_BAND_VM 1 // pre-allocate reserved vm range
#endif // TARGET_OS_OSX || TARGET_OS_SIMULATOR
typedef enum {
NANO_NONE = 0,
NANO_V1 = 1,
NANO_V2 = 2,
} nano_version_t;
MALLOC_NOEXPORT
extern nano_version_t _malloc_engaged_nano;
MALLOC_NOEXPORT
extern unsigned int nano_common_max_magazines;
MALLOC_NOEXPORT
extern boolean_t nano_common_max_magazines_is_ncpu;
MALLOC_NOEXPORT
void
nano_common_cpu_number_override_set(void);
MALLOC_NOEXPORT
void
nano_common_init(const char *envp[], const char *apple[], const char *bootargs);
MALLOC_NOEXPORT
void
nano_common_configure(void);
MALLOC_NOEXPORT
void *
nano_common_allocate_based_pages(size_t size, unsigned char align,
unsigned debug_flags, int vm_page_label, void *base_addr);
MALLOC_NOEXPORT
boolean_t
nano_common_allocate_vm_space(mach_vm_address_t base, mach_vm_size_t size);
MALLOC_NOEXPORT
void
nano_common_deallocate_pages(void *addr, size_t size, unsigned debug_flags);
MALLOC_NOEXPORT
kern_return_t
nano_common_default_reader(task_t task, vm_address_t address, vm_size_t size,
void **ptr);
#endif // __NANO_MALLOC_COMMON_H