rc-js-util
Version:
A collection of TS and C++ utilities to help writing performant and correct applications, achieved through strict typing and (removable) invariant checking.
12 lines • 381 B
JavaScript
/**
* @internal
*/
export function shimWebAssemblyMemory(memory, onGrowCallback) {
const grow = memory.grow.bind(memory);
memory.grow = (pagesToAdd) => {
const previousPageCount = grow(pagesToAdd);
onGrowCallback(memory.buffer, previousPageCount, pagesToAdd);
return previousPageCount;
};
}
//# sourceMappingURL=shim-web-assembly-memory.js.map