Skip to content

Commit cf0a3f3

Browse files
committed
ggml_aligned_malloc : use posix_memalign in macOS too
ggml-ci
1 parent 8aee1a8 commit cf0a3f3

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

ggml/src/ggml.c

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -232,23 +232,6 @@ void * ggml_aligned_malloc(size_t size) {
232232
void * aligned_memory = NULL;
233233
#ifdef GGML_USE_CPU_HBM
234234
int result = hbw_posix_memalign(&aligned_memory, alignment, size);
235-
#elif TARGET_OS_OSX
236-
kern_return_t alloc_status = vm_allocate((vm_map_t) mach_task_self(), (vm_address_t *) &aligned_memory, size, VM_FLAGS_ANYWHERE);
237-
int result = EFAULT;
238-
switch (alloc_status) {
239-
case KERN_SUCCESS:
240-
result = 0;
241-
break;
242-
case KERN_INVALID_ADDRESS:
243-
result = EINVAL;
244-
break;
245-
case KERN_NO_SPACE:
246-
result = ENOMEM;
247-
break;
248-
default:
249-
result = EFAULT;
250-
break;
251-
}
252235
#else
253236
int result = posix_memalign(&aligned_memory, alignment, size);
254237
#endif

0 commit comments

Comments
 (0)