This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 2/3] move gimple_canonical_types htab out of gc memory
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: tsaunders at mozilla dot com
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 24 Nov 2014 13:12:08 +0100
- Subject: Re: [PATCH 2/3] move gimple_canonical_types htab out of gc memory
- Authentication-results: sourceware.org; auth=none
- References: <1416802296-15833-1-git-send-email-tsaunders at mozilla dot com> <1416802296-15833-3-git-send-email-tsaunders at mozilla dot com>
On Mon, Nov 24, 2014 at 5:11 AM, <tsaunders@mozilla.com> wrote:
> From: Trevor Saunders <tsaunders@mozilla.com>
>
> Hi,
>
> The memory allocated for the hash table is never rooted by anything, so keeping
> it in gc memory only works if it never needs to survive a gc.
Ok.
Thanks,
Richard.
> Trev
>
> lto/
>
> * lto.c (read_cgraph_and_symbols): allocate gimple_canonical_types
> htab with malloc instead of ggc.
> ---
> gcc/lto/lto.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c
> index a1cd958..1ff02f8 100644
> --- a/gcc/lto/lto.c
> +++ b/gcc/lto/lto.c
> @@ -2926,8 +2926,8 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames)
> symtab->state = LTO_STREAMING;
>
> canonical_type_hash_cache = new hash_map<const_tree, hashval_t> (251);
> - gimple_canonical_types = htab_create_ggc (16381, gimple_canonical_type_hash,
> - gimple_canonical_type_eq, 0);
> + gimple_canonical_types = htab_create (16381, gimple_canonical_type_hash,
> + gimple_canonical_type_eq, NULL);
> gcc_obstack_init (&tree_scc_hash_obstack);
> tree_scc_hash = new hash_table<tree_scc_hasher> (4096);
>
> --
> 2.1.3
>