Skip to content

feat(memory): Phase 2 — typed allocator + AssetManagerSlab — closes #694 #695 - #727

Merged
JeanPhilippeKernel merged 1 commit into
developfrom
feat/phase2-asset-manager-slab
Sep 1, 2026
Merged

feat(memory): Phase 2 — typed allocator + AssetManagerSlab — closes #694 #695#727
JeanPhilippeKernel merged 1 commit into
developfrom
feat/phase2-asset-manager-slab

Conversation

@JeanPhilippeKernel

Copy link
Copy Markdown
Owner

Closes #694, #695. Phase 2 of the TLSF memory roadmap.

#694 — Typed allocator for Array and UnorderedHashMap

  • Array::init(TLSFSlab*, capacity) and init(TLSFSlab*, capacity, size)
  • reserve() calls slab->Realloc (O(1) in-place) vs ZResize on arena
  • Destructor calls slab->Free(m_data) — slab-backed arrays return memory on destroy
  • Move constructor/assignment propagate m_slab, null the source
  • UnorderedHashMap::init(TLSFSlab*, capacity)rehash() uses slab when set

#695 — AssetManagerSlab + container migration

  • 256 MB ContainerSlab carved from Arena at Initialize
  • 5 long-lived growing containers migrated: NodeHierarchies, Meshes, Materials, UUIDToTextureHandle, UUIDToMaterialSlot
  • Expected impact: ~217 KB dead blocks per import session → near zero; ~20 MB reclaimed after 100 sessions

…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()
@JeanPhilippeKernel JeanPhilippeKernel added this to the Stable Core (1.0.0) milestone Sep 1, 2026
@JeanPhilippeKernel JeanPhilippeKernel added enhancement New feature or request area-rendering area-linux Work on Linux system area-window Work on Window system area-macOS Work on macOS system labels Sep 1, 2026
@JeanPhilippeKernel JeanPhilippeKernel self-assigned this Sep 1, 2026
@JeanPhilippeKernel
JeanPhilippeKernel merged commit a806544 into develop Sep 1, 2026
17 checks passed
@JeanPhilippeKernel
JeanPhilippeKernel deleted the feat/phase2-asset-manager-slab branch September 1, 2026 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-linux Work on Linux system area-macOS Work on macOS system area-rendering area-window Work on Window system enhancement New feature or request vulkan-api

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(memory): typed allocator parameter for Array<T> and UnorderedHashMap — Phase 2 prerequisite

1 participant