Skip to main content

Module memory

Module memory 

Source
Expand description

Runtime memory accounting.

The accounting is intentionally explicit:

  • allocations are charged when capacity is acquired;
  • replacements release the old allocation;
  • Drop releases the final allocation;
  • failed reservations never modify the current value.

Order for overwrite (S3):

reserve(new) → liberar old → instalar new

Never install before releasing the previous charge.

Structs§

HeapBytes
Opaque byte buffer charged against a MemoryBudget.
HeapStr
UTF-8 heap buffer charged against a MemoryBudget.
MemoryBudget
Process- or scope-wide byte budget with atomic charge/release.
MemoryLimit
Hard ceiling for a MemoryBudget.
MemorySnapshot
Point-in-time view of a budget (read-only observability).

Enums§

MemoryError
Fail-closed memory reservation error.