Swapping two blocks of memory that reside inside a larger block, in constant memory - The Old New Thing

A variation on the constant-memory rotation.

The Old New Thing