mempool test: iterate from page size
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sat, 9 Mar 2024 02:16:33 +0000 (21:16 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sat, 9 Mar 2024 02:16:33 +0000 (21:16 -0500)
Fix test on ppc64, which has a 64kB page size.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I6e309855c190b056d886aa3c187a9dc1929d7391

src/rseq-utils.h
tests/mempool_test.c

index f6749d3c24e3da32820dca1cfc07b52d4d6a05d7..4c1ea33f66f45feabf52c7eab02f40c5d582df14 100644 (file)
@@ -1,8 +1,11 @@
 // SPDX-License-Identifier: MIT
 // SPDX-FileCopyrightText: 2024 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
 
-#ifndef _RSEQ_UTILS_H
-#define _RSEQ_UTILS_H
+#ifndef _RSEQ_COMMON_UTILS_H
+#define _RSEQ_COMMON_UTILS_H
+
+#include <stdbool.h>
+#include <stdint.h>
 
 #define RSEQ_ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
 
@@ -131,4 +134,4 @@ off_t offset_align(uintptr_t p, size_t alignment)
        return (alignment - p) & (alignment - 1);
 }
 
-#endif /* _RSEQ_UTILS_H */
+#endif /* _RSEQ_COMMON_UTILS_H */
index 0fe44cab471365419005abf9f5c9e775850a674f..8911fdee8c0f40350105b27e4dd3737c8f813677 100644 (file)
@@ -19,6 +19,7 @@
 #include <unistd.h>
 
 #include <rseq/mempool.h>
+#include "../src/rseq-utils.h"
 
 #include "list.h"
 #include "tap.h"
@@ -198,8 +199,8 @@ int main(void)
 
        plan_no_plan();
 
-       /* From 4kB to 4MB */
-       for (len = 4096; len < 4096 * 1024; len <<= 1) {
+       /* From page size to 4MB */
+       for (len = rseq_get_page_len(); len < 4096 * 1024; len <<= 1) {
                test_mempool_fill(len);
        }
 
This page took 0.025981 seconds and 4 git commands to generate.