From acd217aa4241a973fcc5605f31a364af66049f32 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Thu, 3 Oct 2024 18:50:04 +0200 Subject: Use 4 KiB blocks if sysconf(_SC_PAGESIZE) fails --- lib/alloc/arena_alloc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'lib/alloc') diff --git a/lib/alloc/arena_alloc.c b/lib/alloc/arena_alloc.c index d953423..965c6a7 100644 --- a/lib/alloc/arena_alloc.c +++ b/lib/alloc/arena_alloc.c @@ -60,9 +60,7 @@ alloc(allocator_t mem, ptrdiff_t nmemb, ptrdiff_t elemsz, ptrdiff_t align) arena_ctx_t *ctx = mem.ctx; if (ctx->blksz == 0) { long blksz = sysconf(_SC_PAGESIZE); - if (blksz == -1) - errjmp(mem.err); - ctx->blksz = blksz; + ctx->blksz = blksz == -1 ? 4096 : blksz; } ptrdiff_t bufsz; -- cgit v1.2.3