Skip to main content

Module limits

Module limits 

Source
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 seconds have passed. Zero disables it.