aboutsummaryrefslogtreecommitdiff
path: root/gcc/ggc.h
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.h
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.h')
-rw-r--r--gcc/ggc.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/gcc/ggc.h b/gcc/ggc.h
index b2cfb27..2c12a13 100644
--- a/gcc/ggc.h
+++ b/gcc/ggc.h
@@ -165,3 +165,36 @@ void mark_expr_status PROTO ((struct expr_status *));
void mark_stmt_status PROTO ((struct stmt_status *));
void mark_varasm_status PROTO ((struct varasm_status *));
void mark_optab PROTO ((void *));
+
+/* Statistics. */
+
+/* This structure contains the statistics common to all collectors.
+ Particular collectors can extend this structure. */
+typedef struct ggc_statistics
+{
+ /* The Ith element is the number of nodes allocated with code I. */
+ unsigned num_trees[256];
+ /* The Ith element is the number of bytes allocated by nodes with
+ code I. */
+ size_t size_trees[256];
+ /* The Ith element is the number of nodes allocated with code I. */
+ unsigned num_rtxs[256];
+ /* The Ith element is the number of bytes allocated by nodes with
+ code I. */
+ size_t size_rtxs[256];
+ /* The total number of tree nodes allocated. */
+ unsigned total_num_trees;
+ /* The total size of the tree nodes allocated. */
+ size_t total_size_trees;
+ /* The total number of RTL nodes allocated. */
+ unsigned total_num_rtxs;
+ /* The total size of the RTL nodes allocated. */
+ size_t total_size_rtxs;
+} ggc_statistics;
+
+/* Return the number of bytes allocated at the indicated address. */
+size_t ggc_get_size PROTO ((void *));
+
+/* Used by the various collectors to gather and print statistics that
+ do not depend on the collector in use. */
+void ggc_print_statistics PROTO ((FILE *, ggc_statistics *));