Expand description
Caps on what one command may consume.
A PDF can ask for gigabytes of memory in a few bytes, or keep an interpreter busy for ever. An agent reading documents it did not write must be able to survive that, so every command runs under a memory cap and a time limit and fails with an ordinary error when it hits one.
Structs§
- Capped
- The system allocator with a running total, which ends the process at the cap.
Functions§
- max_
memory - The memory cap in mebibytes; zero when there is none.
- seconds_
left - Seconds until the time limit ends the process, if one is set.
- set_
max_ memory - Caps the memory held at any moment, in mebibytes. Zero lifts the cap.
- set_
timeout - Ends the process with an error once
secondshave passed. Zero disables it.