MCPcopy Index your code
hub / github.com/apache/tvm / commitToWasmMemory

Method commitToWasmMemory

web/src/memory.ts:340–350  ·  view source on GitHub ↗

* Commit all the cached data to WasmMemory. * This function can only be called once. * No further store function should be called. * * @param nbytes Number of bytes to be stored.

(nbytes: number = this.stackTop)

Source from the content-addressed store, hash-verified

338 * @param nbytes Number of bytes to be stored.
339 */
340 commitToWasmMemory(nbytes: number = this.stackTop): void {
341 // commit all pointer values.
342 while (this.addressToSetTargetValue.length != 0) {
343 const [targetOffset, valueOffset] = this.addressToSetTargetValue.pop() as [
344 number,
345 number
346 ];
347 this.storePtr(targetOffset, this.ptrFromOffset(valueOffset));
348 }
349 this.memory.storeRawBytes(this.basePtr, this.viewU8.slice(0, nbytes));
350 }
351
352 /**
353 * Allocate space by number of bytes

Callers 5

registerFuncMethod · 0.80
getGlobalFuncInternalMethod · 0.80
typeKey2IndexMethod · 0.80
packedFuncMethod · 0.80

Calls 5

storePtrMethod · 0.95
ptrFromOffsetMethod · 0.95
popMethod · 0.45
storeRawBytesMethod · 0.45
sliceMethod · 0.45

Tested by

no test coverage detected