bug in realloc in 4.2 version of malloc (uninteresting comments)

Guido van Rossum guido at mcvax.UUCP
Tue Mar 6 01:27:40 AEST 1984


I generally agree with your evaluation of 4.2 malloc.  However I think it is
not fair to blame the author for the fact that realloc_srchlen is
initialized to 4 rather than -1.  After all it is a global variable, so
those programs which use memory compaction (there can't be many, given the
obscure description of this feature in the V7 manual) can be fixed quite
easily to set it to -1 at initialization time.  Of course, the length of
your article probably reflects the time you spent to find the bug --
maybe you had been better off when realloc returned (char*)NULL if it can't
find the original pointer.  This should be a minor change.

Guido (oh, and change the manual page, too) van Rossum, CWI, Amsterdam
	guido @ mcvax



More information about the Comp.unix.wizards mailing list