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: [gc-improv] Convert sese.c to use obstack


> My question is why did we had to use GGC_NEW? ÂI just think that we
> used GGC_NEW only out of laziness.

Yes, GGC_NEW is kind of the easiest (and the sloppiest) memory
allocation interface GCC has - allocate and forget. If the allocated
object should not live in GC memory in the first place, it will be
collected on the next ggc_collect call, but that's an implementation
detail that all such scratch allocations have been relying on.

[...]
>> + Âifsese if_region = (ifsese) obstack_alloc (graphite_obstack,
>> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âsizeof (struct ifsese_s));
>
> Couldn't we avoid the obstacks by replacing all these alloc with XNEW?

Of course, as long as there is a convienent place for corresponding XFREE calls.

-- 
Laurynas


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