The program genC.c writes a program M.c that comprises 256 subroutines each of which takes a 64 bit number and returns another 64 bit number. Both of these numbers are to be construed as 8 field values and the routine multiplies each of those by the same field constant that is built into its name. This program is a unit test of M.c. Here is what to do. Expect “8192 Good”.

Now we make a performance test. We choose the machine page as the portion. We arbitrarily choose an asset of 11 pages to be protected by 3 auxiliary pages. base is a page aligned pointer to 17 pages of long words which are the natural unit of this logic. base[0] to base[11<<9] hold the original asset. We compute the auxiliary pages and put them at base[11<<9] to base[14<<9]. We declare pages 0, 3 and 6 to be lost and copy them to pages 14, 15 and 16 to verify our reconstruction. We zero the original site of the lost pages. We reconstruct from the surviving pages whose arguments are enumerated in sur. After the reconstruction in place all the pages are like new.

On my 2.4 GHz Mac this takes 3.06 sec to do 10000 resurrections of 3 pages from 11.

This somewhat peculiar design pays implicit attention to caches. One of the 256 routines from M.c will easily fit in the instruction cache and have virtually no memory references. There are no conditional branches. This is the sort of code for which modern processors achieve peak performance.