Greg Stein <gstein@lyra.org> writes:
> I believe the hardest question is how the caller should determine their own
> behavior. Let's say the caller has an unbounded loop, creating streams. They
> cannot simply pass the same pool to each svn_stream_create() function,
> because they could end up with a billion streams in that one pool. Thus, the
> guy doing the loop will create a subpool, then call svn_stream_create
> passing the subpool, then clear the subpool and loop. If the create function
> then decides to create a subpool, then we've now got two subpools per
> iteration.
>
> So... this means that option (1) is almost always the proper style. Defer to
> your caller to let them decide how to manage memory. If they are going to
> call you many times, then they may use subpools. Or they simply give you
> their own.
This is pretty persuasive to me. Subpools are for managing loops, so
they should be created by the code doing the loop. Perhaps svn_fs.h
should be revised to match this.
Received on Sat Oct 21 14:36:26 2006