getReallocMessagePackerInstructionPlan

function getReallocMessagePackerInstructionPlan(
    __namedParameters,
): MessagePackerInstructionPlan;

Creates a MessagePackerInstructionPlan that packs a list of realloc instructions.

That is, it splits instruction by chunks of REALLOC_LIMIT (10'240) bytes until the given total size is reached.

Parameters

ParameterType
__namedParameters{ getInstruction: (size) => Instruction; totalSize: number; }
__namedParameters.getInstruction(size) => Instruction
__namedParameters.totalSizenumber

Returns

MessagePackerInstructionPlan

Example

const plan = getReallocMessagePackerInstructionPlan({
  totalSize: additionalDataSize,
  getInstruction: (size) => getExtendInstruction({ length: size }),
});

See

MessagePackerInstructionPlan

On this page