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]: Matrix and vector math required for linear loop transforms


Daniel Berlin wrote:

The real issue with xmalloc'ing them is that some of them have very strange lifetimes.
They were xmalloc'ed when i first started with this stuff, then i moved to ggc_alloc to avoid this problem.
obstack_alloc'ing is probably a better bet, since there does come a point when they all can die.
It is probably either that or using ggc_free on them, which i'm not sure people like.

I like ggc_free fine, if there's no better way.


My feeling is that obstacks are great, in the cases that you can use them. They're fast to allocate, incredibly fast to deallocate, and have very little memory overhead. As longas you're really got a stack-based allocation discipline, we should use 'em, in my opinion.

--
Mark Mitchell
CodeSourcery, LLC
(916) 791-8304
mark@codesourcery.com


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