From 2c716c0441661d721d1f0b220ab69c313b70bba1 Mon Sep 17 00:00:00 2001 From: Przemyslaw Pawelczyk Date: Wed, 6 Sep 2023 01:37:55 +0200 Subject: [PATCH] ggml : use sysconf(_SC_PAGESIZE) instead of getpagesize() derived from BSD sed -i 's,getpagesize(),sysconf(_SC_PAGESIZE),g' ggml.c --- ggml.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ggml.c b/ggml.c index 38b1155c1..50adf18ec 100644 --- a/ggml.c +++ b/ggml.c @@ -194,7 +194,7 @@ typedef void * thread_ret_t; inline static void * ggml_aligned_malloc(size_t size) { void * aligned_memory = NULL; #ifdef GGML_USE_METAL - int result = posix_memalign(&aligned_memory, getpagesize(), size); + int result = posix_memalign(&aligned_memory, sysconf(_SC_PAGESIZE), size); #else int result = posix_memalign(&aligned_memory, GGML_MEM_ALIGN, size); #endif