OSDN Git Service

* gcc.dg/lto/ipacp_0.c: New test.
[pf3gnuchains/gcc-fork.git] / gcc / ggc.h
index 03f534f..bc94d6c 100644 (file)
--- a/gcc/ggc.h
+++ b/gcc/ggc.h
@@ -1,6 +1,7 @@
 /* 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.
 
@@ -225,7 +226,7 @@ extern void *ggc_realloc_stat (void *, size_t MEM_STAT_DECL);
 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);
@@ -237,9 +238,10 @@ extern void dump_ggc_loc_statistics (bool);
 #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)     \
@@ -248,7 +250,7 @@ extern void dump_ggc_loc_statistics (bool);
 #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,                   \
@@ -269,6 +271,14 @@ extern const char *ggc_alloc_string (const char *contents, int length);
    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 *);