summaryrefslogtreecommitdiffstats
path: root/vespamalloc
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@online.no>2023-07-02 22:50:52 +0200
committerTor Egge <Tor.Egge@online.no>2023-07-02 22:50:52 +0200
commit201c6d2f865185958b769c02e2fbb2487946a001 (patch)
tree71ea65b4ce0d4c87a7a451f060f55d0cdd5cf008 /vespamalloc
parent78f20e140db88e1b3ad26ffc3419e408716f4e57 (diff)
Avoid bad alignment parameter for aligned_alloc.
Diffstat (limited to 'vespamalloc')
-rw-r--r--vespamalloc/src/tests/test1/new_test.cpp6
1 files changed, 0 insertions, 6 deletions
diff --git a/vespamalloc/src/tests/test1/new_test.cpp b/vespamalloc/src/tests/test1/new_test.cpp
index d41258fb115..92c9a66f8e8 100644
--- a/vespamalloc/src/tests/test1/new_test.cpp
+++ b/vespamalloc/src/tests/test1/new_test.cpp
@@ -288,13 +288,7 @@ TEST("test memalign") {
}
TEST("test aligned_alloc") {
- verify_alignment(wrap_aligned_alloc(0, 0), 1, 1);
- verify_alignment(wrap_aligned_alloc(0, 1), 1, 1);
verify_alignment(wrap_aligned_alloc(1, 0), 1, 1);
- for (size_t align : {3,7,19}) {
- // According to man pages these should fail, but it seems it rounds up and does best effort
- verify_alignment(wrap_aligned_alloc(align, align*7), 1ul << vespalib::Optimized::msbIdx(align), align*7);
- }
for (size_t align : {1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536}) {
verify_alignment(wrap_aligned_alloc(align, align*7), align, align*7);
}