← All docs
memory_get_peak_usage() - internals
Compiler internals for memory_get_peak_usage(): lowering path, type checks, and runtime helpers.
memory_get_peak_usage() - internals
Where it lives
- Signature:
src/builtins/system/memory_get_peak_usage.rs - Lowering:
src/builtins/semantics.rs(lower_registry_call) - Function symbol:
lower_registry_call()
Lowering notes
- Uses the
runtime_callstrategy from the single-source builtin descriptor. - Emits the typed EIR target
runtime.memory_get_peak_usagethroughBuiltinLoweringContext. - The backend resolves that typed target through
src/codegen/lower_inst/runtime_calls.rs; PHP builtin names do not participate in dispatch.
Semantic descriptor
- Target strategy:
runtime_call - Validation:
shared - Result type source:
declared - Result ownership:
non_heap - Effects:
shared - Requirements:
static (0 requirements) - Callable policy:
dynamic_target - Target support:
macos-aarch64,ios-arm64,ios-sim-arm64,linux-aarch64,linux-x86_64
EIR and runtime boundary
- Typed EIR target:
runtime.memory_get_peak_usage - Backend boundary:
src/codegen/lower_inst/runtime_calls.rsresolves the typed target without PHP-name dispatch.
Signature summary
function memory_get_peak_usage(bool $real_usage = false): int
What the type checker enforces
- Arity: takes 0–1 arguments (1 optional).
Eval interpreter (magician)
- Declaration:
crates/elephc-magician/src/interpreter/builtins/core/memory_get_peak_usage.rs(eval_builtin!) - Execution: generated-runtime ABI (
RuntimeBuiltinId(91)) with a Magician fallback adapter. - Adapter reason:
additional-signature-semantics. - Dispatch hooks:
direct,values