Skip to content

Commit

Permalink
fix bug introduced in using calloc (llama/7701)
Browse files Browse the repository at this point in the history
compilade pointed this out on the previous MR
  • Loading branch information
airlied authored and ggerganov committed Jun 15, 2024
1 parent 224096f commit 8cf2b1d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ggml-alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ ggml_gallocr_t ggml_gallocr_new_n(ggml_backend_buffer_type_t * bufts, int n_bufs
galloc->bufts = calloc(n_bufs, sizeof(ggml_backend_buffer_type_t));
GGML_ASSERT(galloc->bufts != NULL);

galloc->buffers = calloc(n_bufs, sizeof(ggml_backend_buffer_t) * n_bufs);
galloc->buffers = calloc(n_bufs, sizeof(ggml_backend_buffer_t));
GGML_ASSERT(galloc->buffers != NULL);

galloc->buf_tallocs = calloc(n_bufs, sizeof(struct ggml_dyn_tallocr *));
Expand Down

0 comments on commit 8cf2b1d

Please sign in to comment.