Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions ggml/src/ggml-alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,8 @@ static void ggml_dyn_tallocr_insert_block(struct tallocr_chunk * chunk, size_t o
insert_pos++;
}
// shift all blocks from insert_pos onward to make room for the new block
for (int i = chunk->n_free_blocks; i > insert_pos; i--) {
chunk->free_blocks[i] = chunk->free_blocks[i-1];
}
memmove(&chunk->free_blocks[insert_pos + 1], &chunk->free_blocks[insert_pos], (chunk->n_free_blocks - insert_pos) * sizeof(struct free_block));

// insert the new block
chunk->free_blocks[insert_pos].offset = offset;
chunk->free_blocks[insert_pos].size = size;
Expand Down
Loading