F. Alfredo Rego ([log in to unmask]) wrote:
: Here is one function from that source file, for your edification:
: static int replace_page ...
: { char buf[PAGE_SIZE] ;
: if ( !(seek_ok = *((int*)buf) ...
This isn't valid because there is no guarantee that buf is int aligned.
Better to use int buf[PAGE_SIZE/sizeof(int)];
(And round up if you don't think PAGE_SIZE is a power of two. :-)
: I know that memory was
: a super-valuable resource in the old days of legacy systems. Nowadays,
: saving a few words of memory AND paying for the "saving" by recycling
: the same variable for totally different purposes is not necessary.
Not true in all cases. If you have threads, you don't want to blow the
trivially small thread stack of 64Kb on HP-UX if you have recursion.
(Currently the compiler flattens all of the locals.)
And having 1000 4 byte ints/pointers quickly grew when inlining was used.
: why not choose a neutral name that applies to ALL the file operations?
Yes.
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *