Module memory

Module memory 

Source
Expand description

Memory optimization utilities.

This module provides memory-efficient data structures and allocation patterns for high-performance nesting and packing operations.

§Features

  • Object Pool: Reusable object allocation to reduce heap pressure
  • Geometry Instancing: Shared vertex data for repeated geometries
  • Scratch Buffer: Thread-local temporary storage

Structs§

ClearingPool
Object pool that automatically clears returned objects.
GeometryCache
A geometry instance cache for deduplication.
MemoryStats
Memory statistics for monitoring.
ObjectPool
A simple object pool for reusing allocations.
ScratchBuffer
Thread-local scratch buffer for temporary allocations.
SharedGeometry
Shared geometry data for instancing.

Traits§

Clearable
A clearable trait for objects that can be reset for reuse.