This commit is contained in:
jeka committed 2026-04-21 15:18:09 +03:00
1 parent 89419a9cee
commit bda6adb2a7
1 file changed
+4 -2
+4 -2
View File
@@ -79,16 +79,18 @@ void memory_pool_destroy(struct memory_pool* pool) {
return;
}
DEBUG_INFO(DEBUG_CATEGORY_MEMORY, "pool_destroy: allocations=%zu, reuse=%zu", pool->allocations, pool->reuse_count);
int cnt=0;
// Освободить все объекты в пуле
void* obj = pool->free_head;
while (obj) {
void* next = *(void**)obj;
u_free(obj);
cnt++;
obj = next;
}
DEBUG_INFO(DEBUG_CATEGORY_MEMORY, "pool_destroy: allocations=%zu, reuse=%zu, current pool size=%d", pool->allocations, pool->reuse_count, cnt);
pool->free_head = NULL;
pool->free_count = 0;
u_free(pool);