This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 2/3] move gimple_canonical_types htab out of gc memory


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
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]