Vixen
02b45cc4
csharp
public static class FrameArena

The two process-wide arenas: one reset every frame, one for scoped scratch. Both are per-thread, so a worker allocating from them never touches memory another core is writing.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

Frame holds anything whose lifetime is the frame — render command payloads, culling results, layout scratch — and is reset once per frame by the engine loop, not by whoever allocated from it.

Temp is for scratch inside a single call, taken and given back with using var scope = FrameArena.PushTemp();. It exists separately so that a function wanting a scratch buffer does not have to know whether it is inside a frame at all, which matters for the asset pipeline and the editor.

Thread-local means each thread pays for its own blocks. That is the intended cost: an arena shared across threads would need a lock on the one operation that has to be an atomic-free pointer bump.

Fields and properties (2)

  • public static ArenaAllocator Frame

    This thread's frame arena. Reset once per frame by the engine loop.

  • public static ArenaAllocator Temp

    This thread's scratch arena. Used through PushTemp.

Methods (3)

  • public static ArenaAllocator.Scope PushTemp()

    Opens a scratch scope on this thread's Temp arena.

  • public static void ResetFrame()

    Resets this thread's frame arena. Called by the engine loop at a defined frame boundary, after everything holding frame memory has finished with it.

  • public static void Release()

    Releases this thread's arenas entirely. For a worker thread shutting down, and for tests, which would otherwise see each other's high-water marks.

Used by (1)

  • MemoryTestsVixen.Core.Memory.Tests