]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commit
ggml : fix calloc argument ordering. (llama/6820)
authorDave Airlie <redacted>
Mon, 22 Apr 2024 14:05:06 +0000 (00:05 +1000)
committerGeorgi Gerganov <redacted>
Mon, 13 May 2024 08:02:26 +0000 (11:02 +0300)
commita6d264f331d3a4cd98188992a48d0f923532009e
tree153e8e4c0ad0424caaac8b88434fc44dc6e408c8
parent295968601986c64b8f7ce1aa5f012e309271b3a4
ggml : fix calloc argument ordering. (llama/6820)

Latest gcc complains here:
/home/airlied/devel/llama.cpp/ggml-alloc.c: In function ‘ggml_gallocr_new_n’:
/home/airlied/devel/llama.cpp/ggml-alloc.c:374:59: warning: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Wcalloc-transposed-args]
  374 |     ggml_gallocr_t galloc = (ggml_gallocr_t)calloc(sizeof(struct ggml_gallocr), 1);
      |                                                           ^~~~~~
/home/airlied/devel/llama.cpp/ggml-alloc.c:374:59: note: earlier argument should specify number of elements, later size of each element

and a bunch more.

calloc is specified to take nmemb first then size, so realign the code.

In a couple of places there was a * x, 1 so I fixed those to use calloc properly.
ggml-alloc.c
ggml-backend.c