MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / fxGetBufferInfo

Function fxGetBufferInfo

xs/sources/xsDataView.c:861–876  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

859}
860
861txSlot* fxGetBufferInfo(txMachine* the, txSlot* buffer)
862{
863 txSlot* arrayBuffer = buffer->value.reference->next;
864 txSlot* bufferInfo = arrayBuffer->next;
865 if (arrayBuffer->kind == XS_ARRAY_BUFFER_KIND) {
866 if (arrayBuffer->value.arrayBuffer.address == C_NULL)
867 mxTypeError("detached buffer");
868 return bufferInfo;
869 }
870 if (arrayBuffer->kind == XS_HOST_KIND) {
871 if (bufferInfo && (bufferInfo->kind == XS_BUFFER_INFO_KIND))
872 return bufferInfo;
873 }
874 mxTypeError("invalid buffer");
875 return C_NULL;
876}
877
878txInteger fxGetDataViewSize(txMachine* the, txSlot* view, txSlot* buffer)
879{

Callers 2

fx_DataViewFunction · 0.85
fx_TypedArrayFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected