brk's zero-fill behavior on VAXen
Roy Smith
roy at phri.UUCP
Sun Nov 9 00:49:07 AEST 1986
In article <2447 at hcr.UUCP> mike at hcr.UUCP (Mike Tilson) writes:
> I'd like to point out that there is another very good reason to
> set newly allocated memory to a fixed value: buggy programs are much
> less likely to exhibit non-deterministic behavior, which makes it
> much easier to fix problems.
As a straight-forward extension to that idea, there is a very good
reason to make that fixed value 0. On most machines (I hope that doesn't
create of flood of "not on my machine it isn't" postings) the value 0 is an
illegal op code, often HALT. It is also often an illegal pointer, which
will generate some sort of memory fault when dereferenced. The upshot is
that if new memory (initialized to 0 by the system, but not initialized by
your program) is used, you increase the chances of your program stopping
quickly. Sort of a poor man's tagged memory.
--
Roy Smith, {allegra,cmcl2,philabs}!phri!roy
System Administrator, Public Health Research Institute
455 First Avenue, New York, NY 10016
"you can't spell unix without deoxyribonucleic!"
More information about the Comp.unix.wizards
mailing list