aboutsummaryrefslogtreecommitdiff
path: root/gcc/ggc-page.c
diff options
context:
space:
mode:
authorDaniel Berlin <dberlin@dberlin.org>2003-10-27 00:26:52 +0000
committerDaniel Berlin <dberlin@gcc.gnu.org>2003-10-27 00:26:52 +0000
commitb6f611637e7411536dc883100c543547f4b7c03a (patch)
tree4348e45b7dfeeb6d8cce2f6f38df5cb802f97b60 /gcc/ggc-page.c
parent60b6a81550ece89cc0d49dc7741f609c0886d191 (diff)
downloadgcc-b6f611637e7411536dc883100c543547f4b7c03a.zip
gcc-b6f611637e7411536dc883100c543547f4b7c03a.tar.gz
gcc-b6f611637e7411536dc883100c543547f4b7c03a.tar.bz2
ggc-zone.c: New file, zone allocating collector.
2003-10-26 Daniel Berlin <dberlin@dberlin.org> * ggc-zone.c: New file, zone allocating collector. * configure: Accept zone option for --with-gc * configure.in: Ditto. * ggc.h (ggc_pch_count_object): Pass bool indicating stringiness. Update all callers. (ggc_pch_alloc_object): Ditto. (ggc_pch_write_object): Ditto. (ggc_alloc_rtx): Use typed allocation, since all RTX's are of a single type. (ggc_alloc_rtvec): Ditto. (ggc_alloc_tree): Use zone allocation, since some things using this macro aren't a single typecode. * ggc-none.c (ggc_alloc_typed): New function. (ggc_alloc_zone): Ditto. * ggc-page.c: Ditto on both functions. From-SVN: r72971
Diffstat (limited to 'gcc/ggc-page.c')
-rw-r--r--gcc/ggc-page.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/gcc/ggc-page.c b/gcc/ggc-page.c
index 71268ca..198b733 100644
--- a/gcc/ggc-page.c
+++ b/gcc/ggc-page.c
@@ -469,7 +469,10 @@ static void poison_pages (void);
void debug_print_page_list (int);
static void push_depth (unsigned int);
static void push_by_depth (page_entry *, unsigned long *);
-
+struct alloc_zone *rtl_zone = NULL;
+struct alloc_zone *tree_zone = NULL;
+struct alloc_zone *garbage_zone = NULL;
+
/* Push an entry onto G.depth. */
inline static void
@@ -1021,6 +1024,22 @@ static unsigned char size_lookup[257] =
8
};
+/* Typed allocation function. Does nothing special in this collector. */
+
+void *
+ggc_alloc_typed (enum gt_types_enum type ATTRIBUTE_UNUSED, size_t size)
+{
+ return ggc_alloc (size);
+}
+
+/* Zone allocation function. Does nothing special in this collector. */
+
+void *
+ggc_alloc_zone (size_t size, struct alloc_zone *zone ATTRIBUTE_UNUSED)
+{
+ return ggc_alloc (size);
+}
+
/* Allocate a chunk of memory of SIZE bytes. Its contents are undefined. */
void *
@@ -1894,7 +1913,7 @@ init_ggc_pch (void)
void
ggc_pch_count_object (struct ggc_pch_data *d, void *x ATTRIBUTE_UNUSED,
- size_t size)
+ size_t size, bool is_string ATTRIBUTE_UNUSED)
{
unsigned order;
@@ -1937,7 +1956,7 @@ ggc_pch_this_base (struct ggc_pch_data *d, void *base)
char *
ggc_pch_alloc_object (struct ggc_pch_data *d, void *x ATTRIBUTE_UNUSED,
- size_t size)
+ size_t size, bool is_string ATTRIBUTE_UNUSED)
{
unsigned order;
char *result;
@@ -1966,7 +1985,7 @@ ggc_pch_prepare_write (struct ggc_pch_data *d ATTRIBUTE_UNUSED,
void
ggc_pch_write_object (struct ggc_pch_data *d ATTRIBUTE_UNUSED,
FILE *f, void *x, void *newx ATTRIBUTE_UNUSED,
- size_t size)
+ size_t size, bool is_string ATTRIBUTE_UNUSED)
{
unsigned order;
static const char emptyBytes[256];