Loading...
tests/posix_memalign_test.c libmalloc-474.0.13 libmalloc-317.100.9
--- libmalloc/libmalloc-474.0.13/tests/posix_memalign_test.c
+++ libmalloc/libmalloc-317.100.9/tests/posix_memalign_test.c
@@ -12,10 +12,10 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-T_GLOBAL_META(T_META_RUN_CONCURRENTLY(true), T_META_TAG_XZONE);
+T_GLOBAL_META(T_META_RUN_CONCURRENTLY(true));
 
 static inline void*
-t_posix_memalign(size_t alignment, size_t size, bool scribble)
+t_posix_memalign(size_t alignment, size_t size)
 {
 	void *ptr = NULL;
 	int result = posix_memalign(&ptr, alignment, size);
@@ -25,13 +25,11 @@
 	T_QUIET; T_ASSERT_EQ((intptr_t)ptr % alignment, 0ul, "pointer should be properly aligned");
 	T_QUIET; T_EXPECT_LE(size, allocated_size, "allocation size");
 
-	if (scribble) {
-		// Scribble memory pointed to by `ptr` to make sure we're not using that
-		// memory for control structures. This also makes sure the memory can be
-		// written to.
-		const uint64_t pat = 0xdeadbeefcafebabeull;
-		memset_pattern8(ptr, &pat, size);
-	}
+	// Scribble memory pointed to by `ptr` to make sure we're not using that
+	// memory for control structures. This also makes sure the memory can be
+	// written to.
+	const uint64_t pat = 0xdeadbeefcafebabeull;
+	memset_pattern8(ptr, &pat, size);
 	return ptr;
 }
 
@@ -40,7 +38,7 @@
 	for (size_t alignment = sizeof(void*); alignment < 4096; alignment *= 2) {
 		// test several sizes
 		for (size_t size = alignment; size <= 256*alignment; size += 8) {
-			void* ptr = t_posix_memalign(alignment, size, true);
+			void* ptr = t_posix_memalign(alignment, size);
 			free(ptr);
 		}
 	}
@@ -79,20 +77,3 @@
 	T_QUIET; T_ASSERT_EQ(result, 0, "posix_memalign should not return an error when asked for size 0");
 	free(ptr);
 }
-
-#if defined(__LP64__) && TARGET_OS_OSX
-T_DECL(posix_memalign_large, "posix_memalign all power of two alignments up to 64GB")
-{
-	uint64_t max_alignment = UINT64_C(68719476736);
-	if (getenv("MallocSecureAllocator")) {
-		max_alignment = 1024 * 1024; // TODO: support for larger alignments
-	}
-	for (size_t alignment = sizeof(void*); alignment <= max_alignment; alignment *= 2) {
-		// don't scribble - we don't want to actually touch that many pages, we just
-		// verify that the allocated pointer looks reasonable
-		void* ptr = t_posix_memalign(alignment, alignment, false);
-		free(ptr);
-	}
-	T_END;
-}
-#endif // __LP64__ && TARGET_OS_OSX