diff options
author | Mattias Andrée <maandree@kth.se> | 2018-11-24 01:48:25 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2018-11-24 01:48:25 +0100 |
commit | 1ebef0a393ddbc27a1e6071d8364b43a42277c77 (patch) | |
tree | 3d43f20ab0c3c9903b11b06a14d693ee2ea17ea0 /vmemalloc.c | |
parent | Add tests (diff) | |
download | libsimple-1ebef0a393ddbc27a1e6071d8364b43a42277c77.tar.gz libsimple-1ebef0a393ddbc27a1e6071d8364b43a42277c77.tar.bz2 libsimple-1ebef0a393ddbc27a1e6071d8364b43a42277c77.tar.xz |
Add [raw]memelem{cpy,move}
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r-- | vmemalloc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/vmemalloc.c b/vmemalloc.c index f79ebb0..8d92035 100644 --- a/vmemalloc.c +++ b/vmemalloc.c @@ -183,7 +183,7 @@ void * libsimple_vmemalloc(size_t n, va_list ap) /* TODO test ([v]{mem,array}alloc) */ { struct memalloc_state state; - size_t misalignment, size, cacheline, min, max; + size_t misalignment, size, cacheline = 64, min, max; void *ptr = NULL; int saved_errno; long int tmp; @@ -225,10 +225,10 @@ libsimple_vmemalloc(size_t n, va_list ap) /* TODO test ([v]{mem,array}alloc) */ 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); + if (tmp >= 1) + cacheline = (size_t)tmp; #else (void) tmp; - cacheline = 64; #endif } |