From 552419f2c0a1550098676ffeec4f7fafa3c2d46f Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Thu, 31 Oct 2024 21:40:11 +0200 Subject: [PATCH] ggml : aligned malloc -> malloc --- ggml/src/ggml.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/ggml/src/ggml.c b/ggml/src/ggml.c index 2d6872e3..264ffb51 100644 --- a/ggml/src/ggml.c +++ b/ggml/src/ggml.c @@ -3836,11 +3836,7 @@ struct ggml_context * ggml_init(struct ggml_init_params params) { ggml_critical_section_end(); - struct ggml_context * ctx = GGML_ALIGNED_MALLOC(sizeof(struct ggml_context)); - if (ctx == NULL) { - GGML_LOG_ERROR("%s: failed to allocate ggml_context\n", __func__); - return NULL; - } + struct ggml_context * ctx = GGML_MALLOC(sizeof(struct ggml_context)); // allow to call ggml_init with 0 size if (params.mem_size == 0) { @@ -3892,7 +3888,7 @@ void ggml_free(struct ggml_context * ctx) { GGML_ALIGNED_FREE(ctx->mem_buffer); } - GGML_ALIGNED_FREE(ctx); + GGML_FREE(ctx); } size_t ggml_used_mem(const struct ggml_context * ctx) {