allocatePluginFunctionIndex
function allocatePluginFunctionIndex(): number;Defined in: packages/engine/src/vm/VMBuiltins.ts:1119
Allocate a unique index into pluginFunctionRegistry for a package’s plugin function.
Call once per function, typically at module scope, right where the function is defined, and store the result in a constant. Don’t hardcode an index: two packages independently picking the same arbitrary number would silently overwrite each other’s handler in the shared registry.
Returns
Section titled “Returns”number
Throws
Section titled “Throws”If the index pool (0-255, a single opcode-stream byte) is exhausted.