Expand description
Pillar: II. PACR field: Λ.
Landauer-on-Drop Global Allocator — the thermodynamic nervous system.
Standalone crate extracted from aevum-core so other crates can depend on
Landauer accounting without pulling in the full aevum-core dependency tree.
§Why intercept dealloc?
In Rust, when a variable’s lifetime ends the Drop trait fires and heap
memory is returned to the allocator. This deallocation is physically the
moment when bits are irreversibly erased — the exact event that Landauer’s
principle taxes.
By wrapping every dealloc call we count bits erased continuously, without
any application code having to opt in. TGP is not a function you call;
it is a law the system cannot escape.
§Safety contract
Each unsafe block below wraps exactly one system-allocator call and one atomic counter increment. There is:
- No pointer arithmetic
- No raw memory reads or writes
- No lifetime violations
- No data races (AtomicU64 with Relaxed ordering is sound here: we only need monotonicity, not happens-before synchronisation)
Structs§
- Landauer
Allocator - The Landauer allocator wraps the system allocator and counts bit
erasures on every
dealloccall.
Functions§
- bits_
erased - Read the cumulative bits erased since process start.
- landauer_
cost_ joules - Compute the Landauer dissipation cost in joules for
bitserased at temperaturetemperature_k(Kelvin).