Module budget

Source

Structs§

Budget
CostTracker
MeteredCostComponent
ScaledU64
A helper type that wraps an u64 to signify the wrapped value have been scaled.

Constants§

DEFAULT_HOST_DEPTH_LIMIT
DEFAULT_HOST_DEPTH_LIMIT: This limit applies to the host environment. It guards recursion paths involving the Env and Budget, particularly during operations like conversion, comparison, and deep cloning. The limit is strategically checked at critical recursion points, such as when encountering a Val. As the actual stack usage can be higher, DEFAULT_HOST_DEPTH_LIMIT is conservatively set to a lower value than the XDR limit.
DEFAULT_XDR_RW_LIMITS
These constants are used to set limits on recursion and data length in the context of XDR (de)serialization. They serve as safeguards against both excessive stack allocation, which could cause an unrecoverable SIGABRT, and excessive heap memory allocation.

Traits§

AsBudget