| 349 | } |
| 350 | |
| 351 | static void ggml_dyn_tallocr_reset(struct ggml_dyn_tallocr * alloc) { |
| 352 | for (int i = 0; i < GGML_VBUFFER_MAX_CHUNKS; i++) { |
| 353 | free(alloc->chunks[i]); |
| 354 | alloc->chunks[i] = NULL; |
| 355 | } |
| 356 | alloc->n_chunks = 0; |
| 357 | |
| 358 | #ifdef GGML_ALLOCATOR_DEBUG |
| 359 | for (int i = 0; i < 1024; i++) { |
| 360 | alloc->allocated_tensors[i].tensor = NULL; |
| 361 | } |
| 362 | #endif |
| 363 | } |
| 364 | |
| 365 | static 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)); |
no outgoing calls
no test coverage detected