summaryrefslogtreecommitdiffstats
path: root/vespamalloc/src/tests/test1/new_test.cpp
diff options
context:
space:
mode:
authorHarald Musum <musum@verizonmedia.com>2021-06-29 16:06:31 +0200
committerGitHub <noreply@github.com>2021-06-29 16:06:31 +0200
commit2baf0e8d284b0bd187425913ec4c6f1be1511511 (patch)
treef8052a48727388c0a3170f78040a81994ce26893 /vespamalloc/src/tests/test1/new_test.cpp
parent51dbf8ce94bcc590cfe640eeee7e5afc45ec5a5b (diff)
Revert "Add support for mallinfo2 with glibc 2.33"
Diffstat (limited to 'vespamalloc/src/tests/test1/new_test.cpp')
-rw-r--r--vespamalloc/src/tests/test1/new_test.cpp22
1 files changed, 10 insertions, 12 deletions
diff --git a/vespamalloc/src/tests/test1/new_test.cpp b/vespamalloc/src/tests/test1/new_test.cpp
index ac053323255..9c291b3842e 100644
--- a/vespamalloc/src/tests/test1/new_test.cpp
+++ b/vespamalloc/src/tests/test1/new_test.cpp
@@ -95,19 +95,17 @@ TEST("verify new with alignment = 64 with single element") {
LOG(info, "&s=%p", s.get());
}
-#if __GLIBC_PREREQ(2, 26)
-TEST("verify realloarray") {
- void *arr = calloc(5,5);
- void *arr2 = reallocarray(arr, 800, 5);
- EXPECT_NOT_EQUAL(arr, arr2);
- EXPECT_NOT_EQUAL(nullptr, arr2);
- EXPECT_NOT_EQUAL(ENOMEM, errno);
-
- void *arr3 = reallocarray(arr2, 1u << 33, 1u << 33);
- EXPECT_EQUAL(nullptr, arr3);
- EXPECT_EQUAL(ENOMEM, errno);
+TEST("verify new with alignment = 64 with single element") {
+ struct alignas(64) S {
+ long a;
+ };
+ static_assert(sizeof(S) == 64);
+ static_assert(alignof(S) == 64);
+ auto s = std::make_unique<S>();
+ verify_aligned(s.get());
+ cmp(s.get(), &s->a);
+ LOG(info, "&s=%p", s.get());
}
-#endif
void verify_vespamalloc_usable_size() {
struct AllocInfo { size_t requested; size_t usable;};