Skip to content

Commit fc6286b

Browse files
authored
calloc
1 parent b821125 commit fc6286b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ggml_extend.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,7 @@ struct GGMLRunner {
10411041
}
10421042

10431043
struct ggml_gallocr * ggml_gallocr_new_n_multi(ggml_backend_buffer_type_t * bufts, int n_bufs) {
1044-
struct ggml_gallocr * galloc = (ggml_gallocr_t)calloc(1, sizeof(struct ggml_gallocr));
1044+
struct ggml_gallocr * galloc = (struct ggml_gallocr *)calloc(1, sizeof(struct ggml_gallocr));
10451045
GGML_ASSERT(galloc != NULL);
10461046

10471047
galloc->bufts = calloc(n_bufs, sizeof(ggml_backend_buffer_type_t));
@@ -1089,8 +1089,8 @@ struct ggml_gallocr * ggml_gallocr_new_n_multi(ggml_backend_buffer_type_t * buft
10891089

10901090
int total_n_half = (n_nodes + n_leafs) / 2;
10911091

1092-
int node_buffer_ids[n_nodes];
1093-
int leaf_buffer_ids[n_leafs];
1092+
int * node_buffer_ids = (int *)calloc(n_nodes, sizeof(int));
1093+
int * leaf_buffer_ids = (int *)calloc(n_leafs, sizeof(int));
10941094

10951095
for (int i = 0; i < n_nodes; i++) {
10961096
node_buffer_ids[i] = i < total_n_half ? 0 : 1;

0 commit comments

Comments
 (0)