checkAllocation
function checkAllocation(count, what): void;Defined in: packages/engine/src/vm/AllocationBudget.ts:154
Refuse an allocation this evaluation cannot afford, without recording it.
For the sites that know how big a result will be BEFORE building it and whose
result is charged later, when it is born. A matrix product is the case that
matters: its size is the product of two operands that are each affordable, so
it has to be refused from the shapes alone, before matrixMultiply() takes
the memory. Charging here as well as at birth would bill every matrix twice
and halve the ceiling the host asked for.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
count | number | How many elements the result would have. |
what | string | What they are, in the plural. See chargeAllocation. |
Returns
Section titled “Returns”void
Throws
Section titled “Throws”ALLOCATION_LIMIT_EXCEEDED when the evaluation could not afford them.