Gabriel Dos Reis <g...@integrable-solutions.net> wrote:
>Hi,
>
>Now that we have transitioned to C++, do we still need to use
>placebo like XNEW and XNEWVEC in GCC source code proper?
>(I am not talking about uses in liberty.)
>
>Note that XNEW in particular does not work for types with
>non-default constructors.
>
>We introduced these macros so that they take care of casts
>that were required for going from void* to T*.  A new-expression
>automatically gives a typed pointer.

I believe we also use them to dispatch to xmalloc for hosts that cannot use 
malloc. Another issue that is gone for good with C++ - at least if you use 
'new'. Existing uses already are there, so just go ahead.
Support for constructing and destructing GC objects will be another story of 
course.

Richard.

>-- Gaby


Reply via email to