aboutsummaryrefslogtreecommitdiffstats
path: root/vmemalloc.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2018-11-23 20:38:54 +0100
committerMattias Andrée <maandree@kth.se>2018-11-23 20:38:54 +0100
commitb5ca6729c7b52e8cade6d3808ad8280845ac32ea (patch)
tree0ddac006e8a6bad962c7c981449ba43fb4bc195f /vmemalloc.c
parentAdd a bunch of function and macros (diff)
downloadlibsimple-b5ca6729c7b52e8cade6d3808ad8280845ac32ea.tar.gz
libsimple-b5ca6729c7b52e8cade6d3808ad8280845ac32ea.tar.bz2
libsimple-b5ca6729c7b52e8cade6d3808ad8280845ac32ea.tar.xz
Some fixes and tests
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--vmemalloc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/vmemalloc.c b/vmemalloc.c
index b4e4ed9..f79ebb0 100644
--- a/vmemalloc.c
+++ b/vmemalloc.c
@@ -223,8 +223,13 @@ libsimple_vmemalloc(size_t n, va_list ap) /* TODO test ([v]{mem,array}alloc) */
n = n ? n : (state.if_zero > 0);
if (state.cache_align || !state.cache_split) {
+#ifdef _SC_LEVEL1_DCACHE_LINESIZE
tmp = sysconf(_SC_LEVEL1_DCACHE_LINESIZE);
cacheline = (size_t)(tmp < 1 ? 64L : tmp);
+#else
+ (void) tmp;
+ cacheline = 64;
+#endif
}
if (state.cache_align) {