public static void swap(Object a, Object b) {
		long sizeA = sizeOf(a);
		long sizeB = sizeOf(b);
		if (sizeA != sizeB)
			throw new UnsupportedOperationException("Objects of different dimension can not be swapped.");
		long temporaryInstanceLocation = $.allocateMemory(sizeA);
		long temporaryInstanceLocation2 = $.allocateMemory(sizeA);
		$.copyMemory(a, 0, null, temporaryInstanceLocation, sizeA);
		$.copyMemory(b, 0, null, temporaryInstanceLocation2, sizeA);
		copyMemory(temporaryInstanceLocation, b, sizeA);
		copyMemory(temporaryInstanceLocation2, a, sizeA);
		$.freeMemory(temporaryInstanceLocation);
		$.freeMemory(temporaryInstanceLocation2);
	}