slaren commited on
Commit
f971b60
·
unverified ·
1 Parent(s): 87d58fe

metal : fix uninitialized abort_callback (llama/8968)

Browse files
Files changed (1) hide show
  1. ggml/src/ggml-metal.m +1 -1
ggml/src/ggml-metal.m CHANGED
@@ -310,7 +310,7 @@ static struct ggml_backend_metal_context * ggml_metal_init(int n_cb) {
310
  GGML_METAL_LOG_INFO("%s: picking default device: %s\n", __func__, [[device name] UTF8String]);
311
 
312
  // Configure context
313
- struct ggml_backend_metal_context * ctx = malloc(sizeof(struct ggml_backend_metal_context));
314
  ctx->device = device;
315
  ctx->n_cb = MIN(n_cb, GGML_METAL_MAX_BUFFERS);
316
  ctx->queue = [ctx->device newCommandQueue];
 
310
  GGML_METAL_LOG_INFO("%s: picking default device: %s\n", __func__, [[device name] UTF8String]);
311
 
312
  // Configure context
313
+ struct ggml_backend_metal_context * ctx = calloc(1, sizeof(struct ggml_backend_metal_context));
314
  ctx->device = device;
315
  ctx->n_cb = MIN(n_cb, GGML_METAL_MAX_BUFFERS);
316
  ctx->queue = [ctx->device newCommandQueue];