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

Method allocThenSetArgBytes

web/src/memory.ts:478–487  ·  view source on GitHub ↗

* Allocate then set the argument location with a TVMByteArray. * Allocate new temporary space for bytes. * * @param offset The offset to set ot data pointer. * @param data The string content.

(offset: PtrOffset, data: Uint8Array)

Source from the content-addressed store, hash-verified

476 * @param data The string content.
477 */
478 allocThenSetArgBytes(offset: PtrOffset, data: Uint8Array): void {
479 // Note: size of size_t equals sizeof ptr.
480 const headerOffset = this.allocRawBytes(this.memory.sizeofPtr() * 2);
481 const dataOffset = this.allocRawBytes(data.length);
482 this.storeRawBytes(dataOffset, data);
483 this.storeUSize(headerOffset + this.memory.sizeofPtr(), data.length);
484
485 this.addressToSetTargetValue.push([offset, headerOffset]);
486 this.addressToSetTargetValue.push([headerOffset, dataOffset]);
487 }
488
489 /**
490 * Update internal cache views.

Callers 1

setPackedArgumentsMethod · 0.80

Calls 4

allocRawBytesMethod · 0.95
storeRawBytesMethod · 0.95
storeUSizeMethod · 0.95
sizeofPtrMethod · 0.45

Tested by

no test coverage detected