[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: new mem-management for libsvn_fs?

From: Nuutti Kotivuori <naked_at_iki.fi>
Date: 2002-11-01 11:25:48 CET

Ben Collins-Sussman wrote:
> Karl Fogel <kfogel@newton.ch.collab.net> writes:
>>> The real work here is going through every single txn_body_
>>> routine, and teaching it to make 'deep' copies of return-data
>>> into the return pool. Before I start this, I want Old Hundred
>>> Eyes to agree that this is a good approach. :-) cmpilato and I
>>> think it's the way to go.
>>
>> These two eyes are crying with joy :-).
>
> Actually, gstein has a much better method.
>
> Get this:
>
> * create a 2nd pool in each trail called 'scratchpool'.
>
> * make sure that commit_trail() frees trail->scratchpool.
>
> * now slowly, leisurely, teach each dag function to use
> trail->scratchpool for temporary work, and trail->pool for
> return-data.
>
> This allows us to incrementally improve our memory usage, by
> rewriting dag routines one-at-a-time.... very carefully.
>
> *This* solution makes mine eyes cry with joy. :-)

Actually - I was *just* yesterday thinking about these pool problems
and realized the exact same problem: return data should not exist in
the same pool as scratch data - because if it does and we still want
low memory usage, we get back to the "old" way where each function
allocating non-trivial amounts of temporary storage has to do a
subpool for non-return data and clear it at the end, which makes us
lose the benefits of the caller managed pool system.

So, I thought that perhaps two pools should be passed to each function
- but rejected that idea as too cumbersome :-)

But for these trails, it seems like a perfect fit. So yes, good stuff.

-- Naked

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Nov 1 11:26:48 2002

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.