void *fxArrayBuffer(txMachine* the, txSlot* slot, void* data, txInteger byteLength, txInteger maxByteLength)
{
	txSlot* instance;
	txSlot* arrayBuffer;
	txSlot* bufferInfo;
	if (byteLength < 0)
		mxRangeError("invalid byteLength %ld", byteLength);
	mxPush(mxArrayBufferPrototype);
	instance = fxNewArrayBufferInstance(the);
	arrayBuffer = instance->next;
	arrayBuffer->value.arrayBuffer.address = fxNewChunk(the, byteLength);
	bufferInfo = arrayBuffer->next;
	bufferInfo->value.bufferInfo.length = byteLength;
	bufferInfo->value.bufferInfo.maxLength = maxByteLength;
	if (data != NULL)
		c_memcpy(arrayBuffer->value.arrayBuffer.address, data, byteLength);
	else
		c_memset(arrayBuffer->value.arrayBuffer.address, 0, byteLength);
	mxPullSlot(slot);
	return arrayBuffer->value.arrayBuffer.address;
}
void *fxArrayBuffer(txMachine* the, txSlot* slot, void* data, txInteger byteLength, txInteger maxByteLength)
{
	txSlot* instance;
	txSlot* arrayBuffer;
	txSlot* bufferInfo;
	if (byteLength < 0)
		mxRangeError("invalid byteLength %ld", byteLength);
	mxPush(mxArrayBufferPrototype);
	instance = fxNewArrayBufferInstance(the);
	arrayBuffer = instance->next;
	arrayBuffer->value.arrayBuffer.address = fxNewChunk(the, byteLength);
	bufferInfo = arrayBuffer->next;
	bufferInfo->value.bufferInfo.length = byteLength;
	bufferInfo->value.bufferInfo.maxLength = maxByteLength;
	if (data != NULL)
		c_memcpy(arrayBuffer->value.arrayBuffer.address, data, byteLength);
	else
		c_memset(arrayBuffer->value.arrayBuffer.address, 0, byteLength);
	mxPullSlot(slot);
	return arrayBuffer->value.arrayBuffer.address;
}