path: root/unittests/lib
diff options
authorTomohiro Kusumi <>2020-01-06 00:01:10 +0900
committerTomohiro Kusumi <>2020-01-06 00:01:19 +0900
commitfd745bf3cacdd51b58619ae48bfeb0358ddda28e (patch)
tree862b90d3e1240c219405f18f058c9e8f19ab9563 /unittests/lib
parentfa6e7f4fb827adb124dbb97a7f72d64e76b2fe6a (diff)
lib/memalign: remove smalloc()/sfree() dependency
fio_memalign()/fio_memfree() implementation shouldn't depend on smalloc()/sfree() which has dependency on fio code itself. e.g. This forces unittest code to prepare stab functions for smalloc()/sfree(). This smalloc()/sfree() dependency was added by 3114b675fd ("fio: enable cross-thread overlap checking with processes"). Rename fio_memalign()/fio_memfree() to __fio_memalign()/__fio_memfree() and take a function pointer instead of a boolean flag. Add fio_memalign()/fio_memfree() as an inlined wrapper for __fio_memalign()/__fio_memfree() without API change. The only real change here is lib/memalign functions got renamed. Signed-off-by: Tomohiro Kusumi <>
Diffstat (limited to 'unittests/lib')
1 files changed, 2 insertions, 1 deletions
diff --git a/unittests/lib/memalign.c b/unittests/lib/memalign.c
index 854c2744..42a2e31a 100644
--- a/unittests/lib/memalign.c
+++ b/unittests/lib/memalign.c
@@ -1,3 +1,4 @@
+#include <stdlib.h>
#include "../unittest.h"
#include "../../lib/memalign.h"
@@ -5,7 +6,7 @@
static void test_memalign_1(void)
size_t align = 4096;
- void *p = fio_memalign(align, 1234, false);
+ void *p = __fio_memalign(align, 1234, malloc);
if (p)
CU_ASSERT_EQUAL(((int)(uintptr_t)p) & (align - 1), 0);