aboutsummaryrefslogtreecommitdiff
path: root/gcc/ggc-simple.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>1999-10-29 04:17:33 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>1999-10-29 04:17:33 +0000
commit3277221c451318748ffe73c4205ca474fd0b806c (patch)
tree8885ce2ea35f645ae60061b2f77bd345ad926d71 /gcc/ggc-simple.c
parent13e8cf822f1c3b7bf2a3b213036c0f250e02296a (diff)
downloadgcc-3277221c451318748ffe73c4205ca474fd0b806c.zip
gcc-3277221c451318748ffe73c4205ca474fd0b806c.tar.gz
gcc-3277221c451318748ffe73c4205ca474fd0b806c.tar.bz2
ggc.h (struct ggc_statistics): New type.
* ggc.h (struct ggc_statistics): New type. (ggc_get_size): New function. (ggc_print_statistics): Likewise. * ggc-common.c (ggc_stats): New variable. (ggc_mark_rtx_children): Keep statistics. (ggc_mark_tree_children): Likewise. (ggc_print_statistics): New function. * ggc-page.c (struct globals): Add bytes_mapped field. (alloc_anon): Update it. (release_pages): Likewise. (ggc_get_size): New function. (ggc_page_print_statistics): New function. * ggc-simple.c (ggc_get_size): New function. From-SVN: r30251
Diffstat (limited to 'gcc/ggc-simple.c')
-rw-r--r--gcc/ggc-simple.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/ggc-simple.c b/gcc/ggc-simple.c
index f665487..194863e 100644
--- a/gcc/ggc-simple.c
+++ b/gcc/ggc-simple.c
@@ -253,6 +253,15 @@ ggc_mark_if_gcable (p)
G.objects += 1;
}
+size_t
+ggc_get_size (p)
+ void *p;
+{
+ struct ggc_mem *x
+ = (struct ggc_mem *) ((char *)p - offsetof (struct ggc_mem, u));
+ return x->size;
+}
+
static void
clear_marks (x)
struct ggc_mem *x;