]> git.djapps.eu Git - pkg/ggml/sources/ggml/commitdiff
fix bug introduced in using calloc (llama/7701)
authorDave Airlie <redacted>
Sun, 2 Jun 2024 21:59:54 +0000 (07:59 +1000)
committerGeorgi Gerganov <redacted>
Sat, 15 Jun 2024 19:05:47 +0000 (22:05 +0300)
compilade pointed this out on the previous MR

src/ggml-alloc.c

index 1fbd376edf4102fd55d0363950e0dbd51df16e32..0146946ebd7649a8f77515bf01bf479867a6b837 100644 (file)
@@ -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 *));