diff options
author | Mattias Andrée <maandree@kth.se> | 2018-11-23 20:38:54 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2018-11-23 20:38:54 +0100 |
commit | b5ca6729c7b52e8cade6d3808ad8280845ac32ea (patch) | |
tree | 0ddac006e8a6bad962c7c981449ba43fb4bc195f /vmemalloc.c | |
parent | Add a bunch of function and macros (diff) | |
download | libsimple-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 'vmemalloc.c')
-rw-r--r-- | vmemalloc.c | 5 |
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) { |