summaryrefslogtreecommitdiff
path: root/ggml.c
diff options
context:
space:
mode:
authorPrzemysław Pawełczyk <przemoc@gmail.com>2023-09-07 10:15:06 +0200
committerGitHub <noreply@github.com>2023-09-07 11:15:06 +0300
commitfec2fb19e4229aac58c98171c46e77144b99f8a3 (patch)
treeef3ae68596bed6c4e9ef8c089566bed57efd7bbd /ggml.c
parent178b1850ebd21b349cebbee887950e435c5aa2d3 (diff)
ggml : posixify madvise and pagesize (#3037)
* llama : use posix_madvise() instead of madvise() derived from BSD sed -i 's,\<madvise\>,posix_&,g;s,\<MADV_,POSIX_&,g' llama.cpp * ggml : use sysconf(_SC_PAGESIZE) instead of getpagesize() derived from BSD sed -i 's,getpagesize(),sysconf(_SC_PAGESIZE),g' ggml.c * metal : use sysconf(_SC_PAGESIZE) instead of getpagesize() derived from BSD sed -i 's,getpagesize(),sysconf(_SC_PAGESIZE),g' ggml-metal.m
Diffstat (limited to 'ggml.c')
-rw-r--r--ggml.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ggml.c b/ggml.c
index 38b1155c..50adf18e 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