/* Garbage collection for the GNU compiler.
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
This file is part of GCC.
/* A GC implementation must provide these functions. They are internal
to the GC system. */
+/* Forward declare the zone structure. Only ggc_zone implements this. */
+struct alloc_zone;
+
/* Initialize the garbage collector. */
extern void init_ggc (void);
+/* Start a new GGC zone. */
+extern struct alloc_zone *new_ggc_zone (const char *);
+
+/* Free a complete GGC zone, destroying everything in it. */
+extern void destroy_ggc_zone (struct alloc_zone *);
+
/* Start a new GGC context. Memory allocated in previous contexts
will not be collected while the new context is active. */
extern void ggc_push_context (void);
\f
/* Allocation. */
-/* Zone structure. */
-struct alloc_zone;
/* For single pass garbage. */
extern struct alloc_zone *garbage_zone;
/* For regular rtl allocations. */
extern void *ggc_alloc (size_t);
/* Allocate an object into the specified allocation zone. */
extern void *ggc_alloc_zone (size_t, struct alloc_zone *);
-/* Allocate an object of the specified type and size. */
+/* Allocate an object of the specified type and size. */
extern void *ggc_alloc_typed (enum gt_types_enum, size_t);
/* Like ggc_alloc, but allocates cleared memory. */
extern void *ggc_alloc_cleared (size_t);
extern void *ggc_realloc (void *, size_t);
/* Like ggc_alloc_cleared, but performs a multiplication. */
extern void *ggc_calloc (size_t, size_t);
+/* Free a block. To be used when known for certain it's not reachable. */
+extern void ggc_free (void *);
#define ggc_alloc_rtx(CODE) \
((rtx) ggc_alloc_typed (gt_ggc_e_7rtx_def, RTX_SIZE (CODE)))