This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: XDELETEVEC
On Tue, Mar 25, 2008 at 2:04 PM, Alexey Salmin <alexey.salmin@gmail.com> wrote:
> Hello! I'm learning my way around the gcc lexer/cpplib code and I have
> a question about the way it works with memory buffers. It seems that
> arrays are allocated with XNEWVEC macro - generally a good idea of
> course. So I expected to see memory freed with the corresponding macro
> XDELETEVEC and was surprised to find out that it is being freed with
> the simple "free" function in the most cases.
>
> salmin@salmin:~/gcc/src/libcpp$ grep XDELETEVEC * | wc -l
> 5
> salmin@salmin:~/gcc/src/libcpp$ grep 'free (' * | wc -l
> 64
>
> I've checked the Partial transitions list for the corresponding item
> or something but have not found anything.
> So I want to ask: what's wrong with XDELETEVEC (and XDELETE as well)?
Nothing. (In fact these macros would help C++ transition)
They are just not used where they should be (same for OBNEW and other
allocation functions).
Richard.