This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C++ bootstrap (part 3/n): Add GGC_NEW() and friends.


Bernardo Innocenti <bernie@develer.com> writes:

| +/* Type-safe, C++-friendly versions of ggc_alloc() and gcc_calloc().  */
| +#define GGC_NEW(T)		((T *) ggc_alloc (sizeof (T)))
| +#define GGC_CNEW(T)		((T *) ggc_alloc_cleared (sizeof (T)))
| +#define GGC_NEWVEC(T, N)	((T *) ggc_alloc ((N) * sizeof(T)))
| +#define GGC_CNEWVEC(T, N)	((T *) ggc_alloc_cleared ((N) * sizeof(T)))
| +#define GGC_NEWVAR(T, S)	((T *) ggc_alloc ((S)))
| +#define GGC_CNEWVAR(T, S)	((T *) ggc_alloc_cleared ((S)))

Don't we need corresponding GGC_DELETE or GGC_VECDELETE 
(for ggc_free)?

-- Gaby


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]