On Sat, Apr 21, 2007 at 11:27:47AM -0700, Frank Cusack wrote:
On April 21, 2007 6:02:41 PM +0200 Alan DeKok <aland@deployingradius.com> wrote:
Alan DeKok wrote:
This is one place where garbage collection would make the code MUCH easier.
Or, memory pools. Start off with a 1K or 2K pool for a REQUEST*, and allocate any REQUEST specific things from there, including VALUE_PAIRs. It would mean that the pool code would have to be in libradius, and that the pairfoo() interface would be updated to take a memory pool pointer.
It would be just repetitive edits to get that done, though. I think the pool code should be pretty simple. Let's see...
I would try tcmalloc (Linux) or mtmalloc (Solaris) first.
Or talloc, which lets you allocate hierarchially, so when you delete a request, all the stuff in it gets deallocated as well, without having to guess ahead of time how much space it's all gonna take. And it has destructors. http://talloc.samba.org/ -- ----------------------------------------------------------- Paul "TBBle" Hampson, B.Sc, LPI, MCSE On-hiatus Asian Studies student, ANU The Boss, Bubblesworth Pty Ltd (ABN: 51 095 284 361) Paul.Hampson@Pobox.Com Of course Pacman didn't influence us as kids. If it did, we'd be running around in darkened rooms, popping pills and listening to repetitive music. -- Kristian Wilson, Nintendo, Inc, 1989 License: http://creativecommons.org/licenses/by/2.1/au/ -----------------------------------------------------------