Skip to content

Commit cb22464

Browse files
committed
fix: page align to TENSOR_ALIGNMENT
1 parent 33b4308 commit cb22464

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ggml/src/ggml.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ void ggml_log_callback_default(enum ggml_log_level level, const char * text, voi
387387

388388
void * ggml_aligned_malloc(size_t size) {
389389
#if defined(_MSC_VER) || defined(__MINGW32__)
390-
return _aligned_malloc(size, GGUF_DEFAULT_ALIGNMENT);
390+
return _aligned_malloc(size, TENSOR_ALIGNMENT);
391391
#else
392392
if (size == 0) {
393393
GGML_LOG_WARN("Behavior may be unexpected when allocating 0 bytes for ggml_aligned_malloc!\n");
@@ -416,7 +416,7 @@ void * ggml_aligned_malloc(size_t size) {
416416
#elif GGML_USE_METAL
417417
int result = posix_memalign(&aligned_memory, sysconf(_SC_PAGESIZE), size);
418418
#else
419-
int result = posix_memalign(&aligned_memory, GGUF_DEFAULT_ALIGNMENT, size);
419+
int result = posix_memalign(&aligned_memory, TENSOR_ALIGNMENT, size);
420420
#endif
421421
if (result != 0) {
422422
// Handle allocation failure

0 commit comments

Comments
 (0)