Loading...
--- libmalloc/libmalloc-374.100.5/src/nanov2_zone.h
+++ libmalloc/libmalloc-792.80.2/src/nanov2_zone.h
@@ -29,21 +29,22 @@
#pragma mark -
#pragma mark Address Structure
-#if TARGET_OS_OSX || TARGET_OS_SIMULATOR || TARGET_OS_DRIVERKIT
+#if TARGET_OS_OSX || TARGET_OS_SIMULATOR || MALLOC_TARGET_DK_OSX
#define NANOV2_REGION_BITS 15
#define NANOV2_ARENA_BITS 3
#define NANOV2_BLOCK_BITS 12
#define NANOV2_OFFSET_BITS 14
-#else // TARGET_OS_OSX || TARGET_OS_SIMULATOR || TARGET_OS_DRIVERKIT
+#else // TARGET_OS_OSX || TARGET_OS_SIMULATOR || MALLOC_TARGET_DK_OSX
#define NANOV2_REGION_BITS 0
#define NANOV2_ARENA_BITS 3
#define NANOV2_BLOCK_BITS 12
#define NANOV2_OFFSET_BITS 14
-#endif // TARGET_OS_OSX || TARGET_OS_SIMULATOR || TARGET_OS_DRIVERKIT
+#endif // TARGET_OS_OSX || TARGET_OS_SIMULATOR || MALLOC_TARGET_DK_OSX
+
#if NANOV2_REGION_BITS > 0
#define NANOV2_MULTIPLE_REGIONS 1
@@ -69,7 +70,7 @@
// Maximum number of slots per block
#define NANOV2_MAX_SLOTS_PER_BLOCK (NANOV2_BLOCK_SIZE/NANO_REGIME_QUANTA_SIZE)
-// Highest region number.
+// Highest region number supported by this signature
#if NANOV2_MULTIPLE_REGIONS
#define NANOV2_MAX_REGION_NUMBER ((1 << NANOV2_REGION_BITS) - 1)
#else // NANOV2_MULTIPLE_REGIONS
@@ -181,8 +182,10 @@
// Structure overlaid on slots that are on the block freelist.
typedef struct {
uint64_t double_free_guard;
- uint16_t next_slot;
+ uint64_t next_slot; // Legal values are <= NEXT_SLOT_VALID_MASK
} nanov2_free_slot_t;
+
+#define NEXT_SLOT_VALID_MASK 0x7ff
MALLOC_STATIC_ASSERT(
sizeof(nanov2_free_slot_t) <= NANO_REGIME_QUANTA_SIZE,
@@ -258,9 +261,6 @@
// Locks for the current allocation blocks.
_malloc_lock_s current_block_lock[NANO_SIZE_CLASSES][MAX_CURRENT_BLOCKS];
-
- // Lock for delegate_allocations.
- _malloc_lock_s delegate_allocations_lock;
// Mask of size classes for which allocation should be delegated when a new
// block is needed and the class has become full.