/* Garbage collection for the GNU compiler.
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008
- Free Software Foundation, Inc.
+
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007,
+ 2008, 2009 Free Software Foundation, Inc.
This file is part of GCC.
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 *);
-
+
extern void ggc_record_overhead (size_t, size_t, void * MEM_STAT_DECL);
extern void ggc_free_overhead (void *);
extern void ggc_prune_overhead_list (void);
#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_RESIZEVEC(T, P, N) ((T *) ggc_realloc ((P), (N) * sizeof (T)))
#define GGC_NEWVAR(T, S) ((T *) ggc_alloc ((S)))
#define GGC_CNEWVAR(T, S) ((T *) ggc_alloc_cleared ((S)))
-#define GGC_RESIZEVEC(T, P, N) ((T *) ggc_realloc ((P), (N) * sizeof (T)))
+#define GGC_RESIZEVAR(T, P, N) ((T *) ggc_realloc ((P), (N)))
#define ggc_alloc_rtvec(NELT) \
((rtvec) ggc_alloc_zone (sizeof (struct rtvec_def) + ((NELT) - 1) \
#define ggc_alloc_tree(LENGTH) ((tree) ggc_alloc_zone (LENGTH, &tree_zone))
#define htab_create_ggc(SIZE, HASH, EQ, DEL) \
- htab_create_alloc (SIZE, HASH, EQ, DEL, ggc_calloc, NULL)
+ htab_create_alloc (SIZE, HASH, EQ, DEL, ggc_calloc, ggc_free)
#define splay_tree_new_ggc(COMPARE) \
splay_tree_new_with_allocator (COMPARE, NULL, NULL, \
function is called, not during allocations. */
extern void ggc_collect (void);
+/* Register an additional root table. This can be useful for some
+ plugins. Does nothing if the passed pointer is NULL. */
+extern void ggc_register_root_tab (const struct ggc_root_tab *);
+
+/* Register an additional cache table. This can be useful for some
+ plugins. Does nothing if the passed pointer is NULL. */
+extern void ggc_register_cache_tab (const struct ggc_cache_tab *);
+
/* Return the number of bytes allocated at the indicated address. */
extern size_t ggc_get_size (const void *);