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

Method loadByteArrayAsBytes

web/src/memory.ts:244–253  ·  view source on GitHub ↗

* Load bytearray as bytes from ptr. * @param byteArrayPtr The head address of the bytearray.

(byteArrayPtr: Pointer)

Source from the content-addressed store, hash-verified

242 * @param byteArrayPtr The head address of the bytearray.
243 */
244 loadByteArrayAsBytes(byteArrayPtr: Pointer): Uint8Array {
245 if (this.buffer != this.memory.buffer) {
246 this.updateViews();
247 }
248 const ptr = this.loadPointer(byteArrayPtr);
249 const length = this.loadUSize(byteArrayPtr + this.sizeofPtr());
250 const result = new Uint8Array(length);
251 result.set(this.viewU8.slice(ptr, ptr + length));
252 return result;
253 }
254 // private functions
255 /**
256 * Update memory view after the memory growth.

Callers 1

retValueToJSMethod · 0.80

Calls 5

updateViewsMethod · 0.95
loadPointerMethod · 0.95
loadUSizeMethod · 0.95
sizeofPtrMethod · 0.95
sliceMethod · 0.45

Tested by

no test coverage detected