Hrrmmm shouldn't those lines be...

Russ Allbery rra at stanford.edu
Thu Sep 7 22:02:44 UTC 2000


Heath Kehoe <heath.kehoe at intermec.com> writes:

> Because RENEW might have to move the data to make room, so it must
> return the pointer to where the data is, in case it moved.

> Check your man page for realloc (which is what is behind the
> RENEW macro).

The RENEW macro actually also does the assignment, which I think was what
he was seeing.  (This is one of the reasons why I'd like to propose
eventually getting rid of NEW, COPY, DISPOSE, and RENEW and just using
xmalloc, xrealloc, and free directly; the casual reader of the code is
going to have a much easier time understanding what's going on.)

#define RENEW(p, T, c)          (p = xrealloc((p), sizeof(T) * (c)))

-- 
Russ Allbery (rra at stanford.edu)             <http://www.eyrie.org/~eagle/>



More information about the inn-workers mailing list