Skip to content

Commit 6e02327

Browse files
authored
metal : fix uninitialized abort_callback (#8968)
1 parent 7eb2384 commit 6e02327

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ggml/src/ggml-metal.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ static void ggml_metal_log(enum ggml_log_level level, const char * format, ...){
310310
GGML_METAL_LOG_INFO("%s: picking default device: %s\n", __func__, [[device name] UTF8String]);
311311

312312
// Configure context
313-
struct ggml_backend_metal_context * ctx = malloc(sizeof(struct ggml_backend_metal_context));
313+
struct ggml_backend_metal_context * ctx = calloc(1, sizeof(struct ggml_backend_metal_context));
314314
ctx->device = device;
315315
ctx->n_cb = MIN(n_cb, GGML_METAL_MAX_BUFFERS);
316316
ctx->queue = [ctx->device newCommandQueue];

0 commit comments

Comments
 (0)