+/* The internal primitive. */
+extern void *ggc_internal_alloc_stat (size_t MEM_STAT_DECL);
+
+#define ggc_internal_alloc(s) ggc_internal_alloc_stat (s MEM_STAT_INFO)
+
+/* Allocate an object of the specified type and size. */
+extern void *ggc_alloc_typed_stat (enum gt_types_enum, size_t MEM_STAT_DECL);
+
+#define ggc_alloc_typed(s, z) ggc_alloc_typed_stat (s, z MEM_STAT_INFO)
+
+/* Allocates cleared memory. */
+extern void *ggc_internal_cleared_alloc_stat (size_t MEM_STAT_DECL);
+
+/* Resize a block. */
+extern void *ggc_realloc_stat (void *, size_t MEM_STAT_DECL);
+
+/* 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);
+
+extern void dump_ggc_loc_statistics (bool);
+
+/* Reallocators. */
+#define GGC_RESIZEVEC(T, P, N) \
+ ((T *) ggc_realloc_stat ((P), (N) * sizeof (T) MEM_STAT_INFO))
+
+#define GGC_RESIZEVAR(T, P, N) \
+ ((T *) ggc_realloc_stat ((P), (N) MEM_STAT_INFO))
+
+static inline void *
+ggc_internal_vec_alloc_stat (size_t s, size_t c MEM_STAT_DECL)
+{
+ return ggc_internal_alloc_stat (c * s PASS_MEM_STAT);
+}
+
+static inline void *
+ggc_internal_cleared_vec_alloc_stat (size_t s, size_t c MEM_STAT_DECL)
+{
+ return ggc_internal_cleared_alloc_stat (c * s PASS_MEM_STAT);
+}
+
+#define ggc_internal_cleared_vec_alloc(s, c) \
+ (ggc_internal_cleared_vec_alloc_stat ((s), (c) MEM_STAT_INFO))
+
+static inline void *
+ggc_alloc_atomic_stat (size_t s MEM_STAT_DECL)
+{
+ return ggc_internal_alloc_stat (s PASS_MEM_STAT);
+}
+
+#define ggc_alloc_atomic(S) (ggc_alloc_atomic_stat ((S) MEM_STAT_INFO))
+
+#define ggc_alloc_cleared_atomic(S) \
+ (ggc_internal_cleared_alloc_stat ((S) MEM_STAT_INFO))
+
+extern void * ggc_cleared_alloc_htab_ignore_args (size_t, size_t);
+
+extern void * ggc_cleared_alloc_ptr_array_two_args (size_t, size_t);
+
+#define htab_create_ggc(SIZE, HASH, EQ, DEL) \
+ htab_create_typed_alloc (SIZE, HASH, EQ, DEL, \
+ ggc_cleared_alloc_htab_ignore_args, \
+ ggc_cleared_alloc_ptr_array_two_args, \
+ ggc_free)
+
+#define splay_tree_new_ggc(COMPARE, ALLOC_TREE, ALLOC_NODE) \
+ splay_tree_new_typed_alloc (COMPARE, NULL, NULL, &ALLOC_TREE, &ALLOC_NODE, \
+ &ggc_splay_dont_free, NULL)
+
+extern void *ggc_splay_alloc (enum gt_types_enum, int, void *);
+
+extern void ggc_splay_dont_free (void *, void *);
+
+/* Allocate a gc-able string, and fill it with LENGTH bytes from CONTENTS.
+ If LENGTH is -1, then CONTENTS is assumed to be a
+ null-terminated string and the memory sized accordingly. */
+extern const char *ggc_alloc_string_stat (const char *contents, int length
+ MEM_STAT_DECL);
+
+#define ggc_alloc_string(c, l) ggc_alloc_string_stat (c, l MEM_STAT_INFO)
+
+/* Make a copy of S, in GC-able memory. */
+#define ggc_strdup(S) ggc_alloc_string_stat ((S), -1 MEM_STAT_INFO)
+
+/* Invoke the collector. Garbage collection occurs only when this
+ 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 *);
+
+/* Read objects previously saved with gt_pch_save from F. */
+extern void gt_pch_restore (FILE *f);
+\f
+/* Statistics. */
+
+/* Print allocation statistics. */
+extern void ggc_print_statistics (void);
+
+extern void stringpool_statistics (void);
+
+/* Heuristics. */
+extern void init_ggc_heuristics (void);
+
+/* Zone collection. */
+
+/* For regular rtl allocations. */
+extern struct alloc_zone rtl_zone;
+
+/* For regular tree allocations. */
+extern struct alloc_zone tree_zone;
+
+/* For IDENTIFIER_NODE allocations. */
+extern struct alloc_zone tree_id_zone;
+
+#define ggc_alloc_rtvec_sized(NELT) \
+ (ggc_alloc_zone_vec_rtvec_def (sizeof (rtx), \
+ sizeof (struct rtvec_def) + ((NELT) - 1), \
+ &rtl_zone))
+
+#if defined (GGC_ZONE) && !defined (GENERATOR_FILE)
+
+/* Allocate an object into the specified allocation zone. */
+extern void *ggc_internal_alloc_zone_stat (size_t,
+ struct alloc_zone * MEM_STAT_DECL);
+
+extern void *ggc_internal_cleared_alloc_zone_stat (size_t,
+ struct alloc_zone * MEM_STAT_DECL);
+
+static inline void *
+ggc_internal_zone_alloc_stat (struct alloc_zone * z, size_t s MEM_STAT_DECL)
+{
+ return ggc_internal_alloc_zone_stat (s, z PASS_MEM_STAT);
+}
+
+static inline void *
+ggc_internal_zone_cleared_alloc_stat (struct alloc_zone * z, size_t s
+ MEM_STAT_DECL)
+{
+ return ggc_internal_cleared_alloc_zone_stat (s, z PASS_MEM_STAT);
+}
+
+static inline void *
+ggc_internal_zone_vec_alloc_stat (struct alloc_zone * z, size_t s, size_t n
+ MEM_STAT_DECL)
+{
+ return ggc_internal_alloc_zone_stat (s * n, z PASS_MEM_STAT);
+}
+
+
+#else