MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / ggml_dyn_tallocr_new

Function ggml_dyn_tallocr_new

external/ggml/src/ggml-alloc.c:365–381  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

363}
364
365static struct ggml_dyn_tallocr * ggml_dyn_tallocr_new(size_t alignment, size_t max_buffer_size) {
366 struct ggml_dyn_tallocr * alloc = (struct ggml_dyn_tallocr *)malloc(sizeof(struct ggml_dyn_tallocr));
367
368 *alloc = (struct ggml_dyn_tallocr) {
369 /*.alignment = */ alignment,
370 /*.max_chunk_size = */ MIN(max_buffer_size, SIZE_MAX/2), // clamp to avoid overflows
371 /*.chunks = */ {NULL},
372 /*.n_chunks = */ 0,
373#ifdef GGML_ALLOCATOR_DEBUG
374 /*.allocated_tensors = */ {{0}},
375#endif
376 };
377
378 ggml_dyn_tallocr_reset(alloc);
379
380 return alloc;
381}
382
383static void ggml_dyn_tallocr_free(struct ggml_dyn_tallocr * alloc) {
384 for (int i = 0; i < alloc->n_chunks; ++i) {

Callers 1

ggml_gallocr_new_nFunction · 0.85

Calls 1

ggml_dyn_tallocr_resetFunction · 0.85

Tested by

no test coverage detected