void fx_TypedArray_prototype_copyWithin(txMachine* the)
{
	mxMutableTypedArrayDeclarations;
	txInteger delta = dispatch->value.typedArray.dispatch->size;
	txInteger target = (txInteger)fxArgToIndex(the, 0, 0, length);
	txInteger start = (txInteger)fxArgToIndex(the, 1, 0, length);
	txInteger end = (txInteger)fxArgToIndex(the, 2, length, length);
	txInteger count = end - start;
	fxCheckArrayBufferDetached(the, buffer, XS_MUTABLE);
	if (count > length - target)
		count = length - target;
	if (count > 0) {
		txByte* address = buffer->value.reference->next->value.arrayBuffer.address + view->value.dataView.offset;
		c_memmove(address + (target * delta), address + (start * delta), count * delta);
		mxMeterSome((txU4)count * 2);
	}
	mxResult->kind = mxThis->kind;
	mxResult->value = mxThis->value;
}
void fx_TypedArray_prototype_copyWithin(txMachine* the)
{
	mxMutableTypedArrayDeclarations;
	txInteger delta = dispatch->value.typedArray.dispatch->size;
	txInteger target = (txInteger)fxArgToIndex(the, 0, 0, length);
	txInteger start = (txInteger)fxArgToIndex(the, 1, 0, length);
	txInteger end = (txInteger)fxArgToIndex(the, 2, length, length);
	txInteger count = end - start;
	fxCheckArrayBufferDetached(the, buffer, XS_MUTABLE);
	if (count > length - target)
		count = length - target;
	if (count > 0) {
		txByte* address = buffer->value.reference->next->value.arrayBuffer.address + view->value.dataView.offset;
		c_memmove(address + (target * delta), address + (start * delta), count * delta);
		mxMeterSome((txU4)count * 2);
	}
	mxResult->kind = mxThis->kind;
	mxResult->value = mxThis->value;
}