[gc-improv] Permanent vs function RTL obstack fix

Laurynas Biveinis laurynas.biveinis@gmail.com
Tue Apr 12 11:46:00 GMT 2011


[Resending with the correct Mike's address, sorry for the spam]

> So what's the plan for the case where you need to change the lifetime of
> an object?

Copying it. Frankly at the moment I don't how much trouble does deep
copying from scratch to function entails, as mentioned in your other
e-mail. ATM I am working at separating permanent from function. If it
turns out to be unsurmountable, then, well, lesson learned.

> What's the plan for building some kind of consistency
> checking to ensure that we aren't referencing dangling pointers.

I haven't thought them out in detail at this moment, but I had some
ideas, very close to what Steven suggested: poisoning RTL obstacks
instead of freeing/reusing. Walking existing GC memory at RTL function
memory freeing time to see that no pointers point to it. The latter is
virtually free even.

> I ask these questions because they were a serious source of problems in
> the past and any significant revamping of memory management needs to
> have a reasonable story for how to deal with them, else we're taking a
> rather significant step backwards.

I plan to propose merging the branch once such concerns will be
adequately addressed. Personally I believe that it is possible to
address them. In the case it is impossible to address them, I will
propose merging very lite version of the branch that changes RTL
allocation interface, keeps GC behind it, and leaves the rest for
presumably brighter future. Hopefully this will not be the case.

Regarding PCH: so far whenever I touch it, frankly I hate it. In the
current context: the RTL output there was early-generated RTL which
IMHO itself is a sign of a poor IL separation in GCC. So in that
respect I believe my work is a step in a right direction, even if
painful.

Thanks for your feedback,
--
Laurynas



More information about the Gcc-patches mailing list