From: slaren Date: Sat, 10 Aug 2024 13:42:10 +0000 (+0200) Subject: metal : fix uninitialized abort_callback (#8968) X-Git-Tag: upstream/0.0.4488~922 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=6e02327e8b7837358e0406bf90a4632e18e27846;p=pkg%2Fggml%2Fsources%2Fllama.cpp metal : fix uninitialized abort_callback (#8968) --- diff --git a/ggml/src/ggml-metal.m b/ggml/src/ggml-metal.m index 9fc08ab3..aad18943 100644 --- a/ggml/src/ggml-metal.m +++ b/ggml/src/ggml-metal.m @@ -310,7 +310,7 @@ static struct ggml_backend_metal_context * ggml_metal_init(int n_cb) { GGML_METAL_LOG_INFO("%s: picking default device: %s\n", __func__, [[device name] UTF8String]); // Configure context - struct ggml_backend_metal_context * ctx = malloc(sizeof(struct ggml_backend_metal_context)); + struct ggml_backend_metal_context * ctx = calloc(1, sizeof(struct ggml_backend_metal_context)); ctx->device = device; ctx->n_cb = MIN(n_cb, GGML_METAL_MAX_BUFFERS); ctx->queue = [ctx->device newCommandQueue];