* 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)
| 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 |
no test coverage detected