diff options
author | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-10-29 04:17:33 +0000 |
---|---|---|
committer | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-10-29 04:17:33 +0000 |
commit | 4e00b6fd23bf82e4038e115609361fb0c62465f7 (patch) | |
tree | 8885ce2ea35f645ae60061b2f77bd345ad926d71 /gcc/ggc.h | |
parent | 637be39f421b23c745f14f52d76daf974cc93460 (diff) | |
download | gcc-4e00b6fd23bf82e4038e115609361fb0c62465f7.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@30251 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ggc.h')
-rw-r--r-- | gcc/ggc.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/gcc/ggc.h b/gcc/ggc.h index b2cfb279a5c..2c12a139935 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 *)); |