void fx_ArrayBuffer_prototype_transfer(txMachine* the)
{
	/* txSlot* instance = */ fxCheckArrayBufferInstance(the, mxThis);
	txSlot* arrayBuffer = fxCheckArrayBufferDetached(the, mxThis, XS_MUTABLE);
	txSlot* bufferInfo = arrayBuffer->next;
	txInteger oldByteLength = bufferInfo->value.bufferInfo.length;
	txInteger newByteLength = fxArgToByteLength(the, 0, oldByteLength);
	txSlot* resultBuffer;
	fxConstructArrayBufferResult(the, C_NULL, newByteLength);
	resultBuffer = fxCheckArrayBufferDetached(the, mxResult, XS_MUTABLE);
	c_memcpy(resultBuffer->value.arrayBuffer.address, arrayBuffer->value.arrayBuffer.address, (newByteLength < oldByteLength) ? newByteLength : oldByteLength);
	if (newByteLength > oldByteLength)
		c_memset(resultBuffer->value.arrayBuffer.address + oldByteLength, 0, newByteLength - oldByteLength);
	arrayBuffer->value.arrayBuffer.address = C_NULL;
	bufferInfo->value.bufferInfo.length = 0;
}
void fx_ArrayBuffer_prototype_transfer(txMachine* the)
{
	  fxCheckArrayBufferInstance(the, mxThis);
	txSlot* arrayBuffer = fxCheckArrayBufferDetached(the, mxThis, XS_MUTABLE);
	txSlot* bufferInfo = arrayBuffer->next;
	txInteger oldByteLength = bufferInfo->value.bufferInfo.length;
	txInteger newByteLength = fxArgToByteLength(the, 0, oldByteLength);
	txSlot* resultBuffer;
	fxConstructArrayBufferResult(the, C_NULL, newByteLength);
	resultBuffer = fxCheckArrayBufferDetached(the, mxResult, XS_MUTABLE);
	c_memcpy(resultBuffer->value.arrayBuffer.address, arrayBuffer->value.arrayBuffer.address, (newByteLength < oldByteLength) ? newByteLength : oldByteLength);
	if (newByteLength > oldByteLength)
		c_memset(resultBuffer->value.arrayBuffer.address + oldByteLength, 0, newByteLength - oldByteLength);
	arrayBuffer->value.arrayBuffer.address = C_NULL;
	bufferInfo->value.bufferInfo.length = 0;
}