Loading...
--- libmalloc/libmalloc-283.100.6/src/magazine_rack.c
+++ libmalloc/libmalloc-317.40.8/src/magazine_rack.c
@@ -143,10 +143,11 @@
rack->region_generation->nextgen->num_regions_allocated = new_size;
rack->region_generation->nextgen->num_regions_allocated_shift = new_shift;
+ // Ensure everyone sees the advance.
+ OSMemoryBarrier();
+
// Throw the switch to atomically advance to the next generation.
rack->region_generation = rack->region_generation->nextgen;
- // Ensure everyone sees the advance.
- OSMemoryBarrier();
}
// Insert the new region into the hash ring, and update malloc statistics