ggml : use sysconf(_SC_PAGESIZE) instead of getpagesize() derived from BSD

sed -i 's,getpagesize(),sysconf(_SC_PAGESIZE),g' ggml.c
This commit is contained in:
Przemyslaw Pawelczyk 2023-09-06 01:37:55 +02:00
parent 77f9bd7c23
commit 2c716c0441

2
ggml.c
View file

@ -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