Loading...
tests/posix_memalign_test.c libmalloc-657.60.21 libmalloc-521.100.59
--- libmalloc/libmalloc-657.60.21/tests/posix_memalign_test.c
+++ libmalloc/libmalloc-521.100.59/tests/posix_memalign_test.c
@@ -11,11 +11,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include "../src/platform.h"
-
-#if !MALLOC_TARGET_EXCLAVES
 #include <mach/mach.h>
-#endif // !MALLOC_TARGET_EXCLAVES
 
 #include <malloc/malloc.h>
 #include <malloc_private.h>
@@ -23,7 +19,6 @@
 
 T_GLOBAL_META(T_META_RUN_CONCURRENTLY(true), T_META_TAG_XZONE);
 
-#if !MALLOC_TARGET_EXCLAVES
 struct t_recorder_ctx {
 	void *ptr;
 	size_t size;
@@ -86,7 +81,6 @@
 	}
 	T_QUIET; T_FAIL("pointer %p not enumerated in any zone", ptr);
 }
-#endif // !MALLOC_TARGET_EXCLAVES
 
 static inline void *
 t_posix_memalign(size_t alignment, size_t size, bool scribble, bool enumerate)
@@ -100,11 +94,9 @@
 	T_QUIET; T_EXPECT_LE(size, allocated_size, "allocation size");
 
 	T_QUIET; T_EXPECT_TRUE(malloc_claimed_address(ptr), "should be claimed");
-#if !MALLOC_TARGET_EXCLAVES
 	if (enumerate) {
 		check_pointer_is_enumerated(ptr, size);
 	}
-#endif // !MALLOC_TARGET_EXCLAVES
 
 	if (scribble) {
 		// Scribble memory pointed to by `ptr` to make sure we're not using that
@@ -116,8 +108,7 @@
 	return ptr;
 }
 
-T_DECL(posix_memalign_free, "posix_memalign all power of two alignments <= 4096",
-	   T_META_TAG_VM_NOT_PREFERRED)
+T_DECL(posix_memalign_free, "posix_memalign all power of two alignments <= 4096")
 {
 	for (size_t alignment = sizeof(void*); alignment < 4096; alignment *= 2) {
 		bool enumerate = true;
@@ -130,9 +121,7 @@
 	}
 }
 
-T_DECL(posix_memalign_alignment_not_a_power_of_2,
-	   "posix_memalign should return EINVAL if alignment is not a power of 2",
-	   T_META_TAG_VM_PREFERRED)
+T_DECL(posix_memalign_alignment_not_a_power_of_2, "posix_memalign should return EINVAL if alignment is not a power of 2")
 {
 	{
 		void *ptr = NULL;
@@ -149,9 +138,7 @@
 	}
 }
 
-T_DECL(posix_memalign_alignment_not_a_multiple_of_voidstar,
-	   "posix_memalign should return EINVAL if alignment is not a multiple of sizeof(void*)",
-	   T_META_TAG_VM_PREFERRED)
+T_DECL(posix_memalign_alignment_not_a_multiple_of_voidstar, "posix_memalign should return EINVAL if alignment is not a multiple of sizeof(void*)")
 {
 	void *ptr = NULL;
 	const size_t alignment = sizeof(void*)+1;
@@ -160,9 +147,7 @@
 	T_QUIET; T_ASSERT_EQ(result, EINVAL, "posix_memalign should return EINVAL");
 }
 
-T_DECL(posix_memalign_allocate_size_0,
-       "posix_memalign should return something that can be passed to free() when size is 0",
-	   T_META_TAG_VM_PREFERRED)
+T_DECL(posix_memalign_allocate_size_0, "posix_memalign should return something that can be passed to free() when size is 0")
 {
 	void *ptr = NULL;
 	int result = posix_memalign(&ptr, 8, 0);
@@ -171,7 +156,7 @@
 }
 
 #if defined(__LP64__)
-T_DECL(posix_memalign_large, "posix_memalign large power of two alignments", T_META_TAG_VM_NOT_PREFERRED)
+T_DECL(posix_memalign_large, "posix_memalign large power of two alignments")
 {
 	// 64GB on macOS, 64MB on embedded
 	uint64_t max_alignment = TARGET_OS_OSX ? UINT64_C(68719476736) : UINT64_C(67108864);
@@ -184,19 +169,3 @@
 	T_END;
 }
 #endif // __LP64__
-
-T_DECL(posix_memalign_single_page_large,
-		"Allocate tiny blocks with large alignment",
-		T_META_TAG_XZONE_ONLY)
-{
-	void *ptr1 = t_posix_memalign(32768, 1, false, true);
-	T_ASSERT_NOTNULL(ptr1, "Allocated aligned ptr %p", ptr1);
-	void *ptr2 = t_posix_memalign(16*1024, 48 * 1024, false, true);
-	T_ASSERT_NOTNULL(ptr2, "Allocated aligned ptr %p", ptr2);
-	void *ptr3 = t_posix_memalign(32768, 1, false, true);
-	T_ASSERT_NOTNULL(ptr3, "Allocated aligned ptr %p", ptr3);
-
-	free(ptr1);
-	free(ptr2);
-	free(ptr3);
-}