* Allocate then set C-String pointer to the offset. * This function will call into allocBytes to allocate necessary data. * The address won't be set immediately(because the possible change of basePtr) * and will be filled when we commit the data. * * @param offset The offset to set ot
(offset: PtrOffset, data: string)
| 463 | * @param data The string content. |
| 464 | */ |
| 465 | allocThenSetArgString(offset: PtrOffset, data: string): void { |
| 466 | const dataUint8: Uint8Array = StringToUint8Array(data); |
| 467 | const strOffset = this.allocRawBytes(dataUint8.length); |
| 468 | this.storeRawBytes(strOffset, dataUint8); |
| 469 | this.addressToSetTargetValue.push([offset, strOffset]); |
| 470 | } |
| 471 | /** |
| 472 | * Allocate then set the argument location with a TVMByteArray. |
| 473 | * Allocate new temporary space for bytes. |
no test coverage detected