mirror of
https://github.com/pocketpy/pocketpy
synced 2025-12-06 18:20:17 +00:00
Update objectpool.c
This commit is contained in:
parent
b74d336e53
commit
011b03b65a
@ -107,8 +107,8 @@ static int Pool__sweep_dealloc(Pool* self,
|
|||||||
if(item->unused_length == item->block_count) {
|
if(item->unused_length == item->block_count) {
|
||||||
// all free
|
// all free
|
||||||
if(arenas->length > 0) {
|
if(arenas->length > 0) {
|
||||||
// at least one arena
|
// keep at least 1 arena
|
||||||
PoolArena__delete(item);
|
PK_FREE(item);
|
||||||
} else {
|
} else {
|
||||||
// no arena
|
// no arena
|
||||||
c11_vector__push(PoolArena*, arenas, item);
|
c11_vector__push(PoolArena*, arenas, item);
|
||||||
@ -127,7 +127,7 @@ static int Pool__sweep_dealloc(Pool* self,
|
|||||||
} else {
|
} else {
|
||||||
if(item->unused_length == item->block_count) {
|
if(item->unused_length == item->block_count) {
|
||||||
// all free
|
// all free
|
||||||
PoolArena__delete(item);
|
PK_FREE(item);
|
||||||
} else {
|
} else {
|
||||||
// some free
|
// some free
|
||||||
c11_vector__push(PoolArena*, arenas, item);
|
c11_vector__push(PoolArena*, arenas, item);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user