Re: [PATCH] [PR c++/80290] recycle tinst garbage sooner

2018-04-19 Thread Alexandre Oliva
[adding list back] On Apr 18, 2018, Jakub Jelinek wrote: > On Wed, Apr 18, 2018 at 12:29:03AM -0300, Alexandre Oliva wrote: >> + static void free(tinst_level *obj); > ^ >+ missing space Thanks, fixed with this patch: diff --git

Re: [PATCH] [PR c++/80290] recycle tinst garbage sooner

2018-04-18 Thread Alexandre Oliva
On Apr 18, 2018, Jason Merrill wrote: > Ok, thanks. Thanks, here's the consolidated patch I installed. tinst_level objects are created during template instantiation, and they're most often quite short-lived, but since there's no intervening garbage collection, they

Re: [PATCH] [PR c++/80290] recycle tinst garbage sooner

2018-04-17 Thread Jason Merrill
Ok, thanks. On Tue, Apr 17, 2018, 9:29 PM Alexandre Oliva wrote: > On Apr 17, 2018, Jason Merrill wrote: > > >> Any objections to making dec_refcount_use a friend of tinst_level's? > >> Otherwise, I'd rather add a free() member function (or maybe static >

Re: [PATCH] [PR c++/80290] recycle tinst garbage sooner

2018-04-17 Thread Alexandre Oliva
On Apr 17, 2018, Jason Merrill wrote: >> Any objections to making dec_refcount_use a friend of tinst_level's? >> Otherwise, I'd rather add a free() member function (or maybe static >> member function) to free both the TREE_LIST and the tinst_level objects. > Either of those

Re: [PATCH] [PR c++/80290] recycle tinst garbage sooner

2018-04-17 Thread Jason Merrill
On Tue, Apr 17, 2018, 10:25 AM Alexandre Oliva wrote: > On Apr 17, 2018, Jason Merrill wrote: > > > I was thinking maybe_get_node > > 'k > > > I suppose better would be for > > > + if (obj->list_p () && obj->get_decl_maybe ()) > > +

Re: [PATCH] [PR c++/80290] recycle tinst garbage sooner

2018-04-17 Thread Alexandre Oliva
On Apr 17, 2018, Jason Merrill wrote: > I was thinking maybe_get_node 'k > I suppose better would be for > + if (obj->list_p () && obj->get_decl_maybe ()) > + tree_list_freelist ().free (obj->get_node ()); > to be e.g. > obj-> maybe_free_list(); Any objections

Re: [PATCH] [PR c++/80290] recycle tinst garbage sooner

2018-04-16 Thread Jason Merrill
On Mon, Apr 16, 2018 at 9:45 PM, Alexandre Oliva wrote: > On Apr 16, 2018, Jason Merrill wrote: > >> This change looks good. One other nit: get_decl_maybe can also return a >> list, so the name seems wrong. > > Uhh, it's "give me the decl if you got one, but

Re: [PATCH] [PR c++/80290] recycle tinst garbage sooner

2018-04-16 Thread Alexandre Oliva
On Apr 16, 2018, Jason Merrill wrote: > This change looks good. One other nit: get_decl_maybe can also return a > list, so the name seems wrong. Uhh, it's "give me the decl if you got one, but it's ok if you give me a list" (the latter is what makes it _maybe). It replaces

Re: [PATCH] [PR c++/80290] recycle tinst garbage sooner

2018-04-16 Thread Jason Merrill
On Mon, Apr 16, 2018, 3:20 PM Alexandre Oliva wrote: > On Apr 16, 2018, Jason Merrill wrote: > > > On Fri, Apr 13, 2018, 5:19 PM Alexandre Oliva wrote: > >> + tree get_node () const { > >> +if (!split_list_p ()) return tldcl; > >> +

Re: [PATCH] [PR c++/80290] recycle tinst garbage sooner

2018-04-16 Thread Alexandre Oliva
On Apr 16, 2018, Jason Merrill wrote: > On Fri, Apr 13, 2018, 5:19 PM Alexandre Oliva wrote: >> + tree get_node () const { >> +if (!split_list_p ()) return tldcl; >> +else return const_cast (this)->to_list (); >> + } > This looks like a dangerous

Re: [PATCH] [PR c++/80290] recycle tinst garbage sooner

2018-04-16 Thread Jason Merrill
On Fri, Apr 13, 2018, 5:19 PM Alexandre Oliva wrote: > tinst_level objects are created during template instantiation, and > they're most often quite short-lived, but since there's no intervening > garbage collection, they accumulate throughout the pass while most by > far

[PATCH] [PR c++/80290] recycle tinst garbage sooner

2018-04-13 Thread Alexandre Oliva
tinst_level objects are created during template instantiation, and they're most often quite short-lived, but since there's no intervening garbage collection, they accumulate throughout the pass while most by far could be recycled after a short while. The original testcase in PR80290, for example,