mirror of
https://github.com/BlackMATov/evolved.lua.git
synced 2025-12-13 19:48:00 +07:00
the internal garbage collector now collects more garbage
This commit is contained in:
@@ -1222,7 +1222,7 @@ builder_mt:destruction_policy :: id -> builder
|
||||
|
||||
## vX.X.X
|
||||
|
||||
- Nothing yet, stay tuned!
|
||||
- The internal garbage collector now collects more garbage
|
||||
|
||||
## v1.2.0
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
- Improve the performance of required fragments by caching first-level required chunks.
|
||||
- Improve the performance of builders that are used multiple times by caching hint chunks.
|
||||
- Queries can cache major chunks to avoid finding them every time.
|
||||
- Add a function to shrink storages to free unused memory.
|
||||
- observers and events
|
||||
- add INDEX fragment trait
|
||||
- use compact prefix-tree for chunks
|
||||
|
||||
29
evolved.lua
29
evolved.lua
@@ -5922,6 +5922,35 @@ function __evolved_collect_garbage()
|
||||
__release_table(__table_pool_tag.chunk_list, postorder_chunk_stack)
|
||||
end
|
||||
|
||||
for table_tag = 1, __table_pool_tag.__count do
|
||||
local table_pool = __tagged_table_pools[table_tag]
|
||||
for pool_index = 1, table_pool.__size do
|
||||
table_pool[pool_index] = {}
|
||||
end
|
||||
end
|
||||
|
||||
do
|
||||
---@type table<integer, evolved.chunk>
|
||||
local new_entity_chunks = {}
|
||||
|
||||
for entity_primary, entity_chunk in __lua_next, __entity_chunks do
|
||||
new_entity_chunks[entity_primary] = entity_chunk
|
||||
end
|
||||
|
||||
__entity_chunks = new_entity_chunks
|
||||
end
|
||||
|
||||
do
|
||||
---@type table<integer, integer>
|
||||
local new_entity_places = {}
|
||||
|
||||
for entity_primary, entity_place in __lua_next, __entity_places do
|
||||
new_entity_places[entity_primary] = entity_place
|
||||
end
|
||||
|
||||
__entity_places = new_entity_places
|
||||
end
|
||||
|
||||
__evolved_commit()
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user