aboutsummaryrefslogtreecommitdiff
path: root/libc/test/IntegrationTest/test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libc/test/IntegrationTest/test.cpp')
-rw-r--r--libc/test/IntegrationTest/test.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/libc/test/IntegrationTest/test.cpp b/libc/test/IntegrationTest/test.cpp
index 0e48252..19eb255 100644
--- a/libc/test/IntegrationTest/test.cpp
+++ b/libc/test/IntegrationTest/test.cpp
@@ -63,8 +63,8 @@ int atexit(void (*func)(void)) { return LIBC_NAMESPACE::atexit(func); }
// which just hands out continuous blocks from a statically allocated chunk of
// memory.
-static constexpr uint64_t ALIGNMENT = alignof(long double);
-static constexpr uint64_t MEMORY_SIZE = 65336;
+static constexpr uint64_t ALIGNMENT = alignof(double);
+static constexpr uint64_t MEMORY_SIZE = 256 * 1024 /* 256 KiB */;
alignas(ALIGNMENT) static uint8_t memory[MEMORY_SIZE];
static size_t ptr = 0;
@@ -75,7 +75,7 @@ void *malloc(size_t size) {
size = (size + ALIGNMENT - 1) & ~(ALIGNMENT - 1);
size_t old_ptr =
ref.fetch_add(size, LIBC_NAMESPACE::cpp::MemoryOrder::RELAXED);
- if (static_cast<size_t>(old_ptr + size) > MEMORY_SIZE)
+ if (static_cast<size_t>(old_ptr + size) >= MEMORY_SIZE)
return nullptr;
return &memory[old_ptr];
}