Loading...
tests/threaded_stress.c libmalloc-792.1.1 libmalloc-715.100.22
--- libmalloc/libmalloc-792.1.1/tests/threaded_stress.c
+++ libmalloc/libmalloc-715.100.22/tests/threaded_stress.c
@@ -263,15 +263,11 @@
 			if (!remaining_frees--) break;
 			alloc = NULL;
 		}
-
-		// Size without taking ownership to allow another thread to race to free
-		(void)malloc_size(allocations[pos % live_allocations]);
-
 		alloc = atomic_exchange(
 				(_Atomic(void *) *)&allocations[(pos++)%live_allocations],
 				alloc);
 		if (alloc) {
-			// Size again while definitely allocated
+			// Size once while allocated
 			(void)malloc_size(alloc);
 
 			dummy = busy(second);
@@ -279,7 +275,7 @@
 
 			// Calling malloc_size on free pointers isn't safe in exclaves
 #if !MALLOC_TARGET_EXCLAVES
-			// Size again while probably free, but possibly re-allocated
+			// Try again while (possibly) free
 			malloc_size(alloc);
 #endif // !MALLOC_TARGET_EXCLAVES
 		}