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

Method allocThenSetArgString

web/src/memory.ts:465–470  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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.

Callers 1

setPackedArgumentsMethod · 0.80

Calls 3

allocRawBytesMethod · 0.95
storeRawBytesMethod · 0.95
StringToUint8ArrayFunction · 0.90

Tested by

no test coverage detected