Skip to content
Merged
Show file tree
Hide file tree
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
16 changes: 6 additions & 10 deletions distr/flecs.c
Original file line number Diff line number Diff line change
Expand Up @@ -28573,17 +28573,14 @@ ecs_block_allocator_chunk_header_t* flecs_balloc_block(
ECS_SIZEOF(ecs_block_allocator_block_t));

block->memory = first_chunk;
if (!allocator->block_tail) {
ecs_assert(!allocator->block_head, ECS_INTERNAL_ERROR, 0);
block->next = NULL;
allocator->block_head = block;
allocator->block_tail = block;
} else {
block->next = NULL;
allocator->block_tail->next = block;
allocator->block_tail = block;
block->next = NULL;

if (allocator->block_head) {
block->next = allocator->block_head;
}

allocator->block_head = block;

ecs_block_allocator_chunk_header_t *chunk = first_chunk;
int32_t i, end;
for (i = 0, end = allocator->chunks_per_block - 1; i < end; ++i) {
Expand Down Expand Up @@ -28619,7 +28616,6 @@ void flecs_ballocator_init(
ba->block_size = ba->chunks_per_block * ba->chunk_size;
ba->head = NULL;
ba->block_head = NULL;
ba->block_tail = NULL;
}

ecs_block_allocator_t* flecs_ballocator_new(
Expand Down
1 change: 0 additions & 1 deletion distr/flecs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1554,7 +1554,6 @@ typedef struct ecs_block_allocator_chunk_header_t {
typedef struct ecs_block_allocator_t {
ecs_block_allocator_chunk_header_t *head;
ecs_block_allocator_block_t *block_head;
ecs_block_allocator_block_t *block_tail;
int32_t chunk_size;
int32_t data_size;
int32_t chunks_per_block;
Expand Down
1 change: 0 additions & 1 deletion include/flecs/datastructures/block_allocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ typedef struct ecs_block_allocator_chunk_header_t {
typedef struct ecs_block_allocator_t {
ecs_block_allocator_chunk_header_t *head;
ecs_block_allocator_block_t *block_head;
ecs_block_allocator_block_t *block_tail;
int32_t chunk_size;
int32_t data_size;
int32_t chunks_per_block;
Expand Down
16 changes: 6 additions & 10 deletions src/datastructures/block_allocator.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,14 @@ ecs_block_allocator_chunk_header_t* flecs_balloc_block(
ECS_SIZEOF(ecs_block_allocator_block_t));

block->memory = first_chunk;
if (!allocator->block_tail) {
ecs_assert(!allocator->block_head, ECS_INTERNAL_ERROR, 0);
block->next = NULL;
allocator->block_head = block;
allocator->block_tail = block;
} else {
block->next = NULL;
allocator->block_tail->next = block;
allocator->block_tail = block;
block->next = NULL;

if (allocator->block_head) {
block->next = allocator->block_head;
}

allocator->block_head = block;

ecs_block_allocator_chunk_header_t *chunk = first_chunk;
int32_t i, end;
for (i = 0, end = allocator->chunks_per_block - 1; i < end; ++i) {
Expand Down Expand Up @@ -78,7 +75,6 @@ void flecs_ballocator_init(
ba->block_size = ba->chunks_per_block * ba->chunk_size;
ba->head = NULL;
ba->block_head = NULL;
ba->block_tail = NULL;
}

ecs_block_allocator_t* flecs_ballocator_new(
Expand Down
Loading