Loading...
--- libmalloc/libmalloc-474.0.13/src/nanov2_zone.h
+++ libmalloc/libmalloc-374.100.5/src/nanov2_zone.h
@@ -29,22 +29,21 @@
 #pragma mark -
 #pragma mark Address Structure
 
-#if TARGET_OS_OSX || TARGET_OS_SIMULATOR || MALLOC_TARGET_DK_OSX
+#if TARGET_OS_OSX || TARGET_OS_SIMULATOR || TARGET_OS_DRIVERKIT
 
 #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 || MALLOC_TARGET_DK_OSX
+#else // TARGET_OS_OSX || TARGET_OS_SIMULATOR || TARGET_OS_DRIVERKIT
 
 #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 || MALLOC_TARGET_DK_OSX
-
+#endif // TARGET_OS_OSX || TARGET_OS_SIMULATOR || TARGET_OS_DRIVERKIT
 
 #if NANOV2_REGION_BITS > 0
 #define NANOV2_MULTIPLE_REGIONS	1
@@ -70,7 +69,7 @@
 // Maximum number of slots per block
 #define NANOV2_MAX_SLOTS_PER_BLOCK	(NANOV2_BLOCK_SIZE/NANO_REGIME_QUANTA_SIZE)
 
-// Highest region number supported by this signature
+// Highest region number.
 #if NANOV2_MULTIPLE_REGIONS
 #define NANOV2_MAX_REGION_NUMBER	((1 << NANOV2_REGION_BITS) - 1)
 #else 	// NANOV2_MULTIPLE_REGIONS
@@ -182,10 +181,8 @@
 // Structure overlaid on slots that are on the block freelist.
 typedef struct {
     uint64_t double_free_guard;
-    uint64_t next_slot; // Legal values are <= NEXT_SLOT_VALID_MASK
+    uint16_t next_slot;
 } nanov2_free_slot_t;
-
-#define NEXT_SLOT_VALID_MASK 0x7ff
 
 MALLOC_STATIC_ASSERT(
 		sizeof(nanov2_free_slot_t) <= NANO_REGIME_QUANTA_SIZE,
@@ -261,6 +258,9 @@
 
 	// 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.