This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C++ bootstrap (part 3/n): Add GGC_NEW() and friends.
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Bernardo Innocenti <bernie at develer dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: 25 Jul 2004 22:42:40 +0200
- Subject: Re: C++ bootstrap (part 3/n): Add GGC_NEW() and friends.
- Organization: Integrable Solutions
- References: <4102FC42.5050503@develer.com>
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