feat(memory): Phase 2 — typed allocator + AssetManagerSlab — closes #694 #695 - #727
Merged
Merged
Conversation
…Slab — closes #694 #695 #694 — Array<T> and UnorderedHashMap<K,V> now accept TLSFSlab*: - Array: init(slab, capacity) / init(slab, capacity, size) overloads; reserve() calls slab->Realloc when m_slab is set (O(1) in-place); destructor calls slab->Free(m_data) to return backing memory - UnorderedHashMap: init(slab, slot_capacity) overload; rehash() uses m_entries.init(slab, ...) when m_slab is set - Move constructor/assignment propagate m_slab, null the source slab #695 — AssetManagerSlab + container migration: - ContainerSlab (256 MB, from Arena) created at Initialize - 5 long-lived growing containers migrated to the slab: NodeHierarchies, Meshes, Materials, UUIDToTextureHandle, UUIDToMaterialSlot - Remaining containers stay on Arena (GPUMeshMaterials, Textures, MeshToHierarchySlot) - Shutdown calls ContainerSlab.Shutdown()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #694, #695. Phase 2 of the TLSF memory roadmap.
#694 — Typed allocator for Array and UnorderedHashMap
Array::init(TLSFSlab*, capacity)andinit(TLSFSlab*, capacity, size)reserve()callsslab->Realloc(O(1) in-place) vsZResizeon arenaslab->Free(m_data)— slab-backed arrays return memory on destroym_slab, null the sourceUnorderedHashMap::init(TLSFSlab*, capacity)—rehash()uses slab when set#695 — AssetManagerSlab + container migration
ContainerSlabcarved fromArenaatInitializeNodeHierarchies,Meshes,Materials,UUIDToTextureHandle,UUIDToMaterialSlot