Message ID | 1416802296-15833-3-git-send-email-tsaunders@mozilla.com |
---|---|
State | New |
Headers | show |
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 >
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);
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. 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(-)