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

Re: [DESIGN] Stacked resources ownership model?

From: Erik Huelsmann <ehuels_at_gmail.com>
Date: 2005-12-15 23:51:25 CET

On 12/15/05, Greg Hudson <ghudson@mit.edu> wrote:
> On Thu, 2005-12-15 at 21:55 +0100, Erik Huelsmann wrote:
> > Exactly, because it doesn't solve the case where I want to be able to
> > return a stream which is already stacked on a resource I'm not
> > returning.
>
> Ah, I see now.
>
> So, I see the credible options as:
>
> 1. Create an ownership-breaking stream for temporarily stacking
> streams on top of resources you don't own.
>
> 2. When you're temporarily stacking a stream on an un-owned resource,
> just don't close the stream. Add an svn_stream_flush() if we have to.
>
> Either is fine with me; you know the details better than I do.

Ok. I'll go with (1) then, because with (2) we can end up with a
number of streams all independently stacked on the same stream.
Especially if / when we decide to register destructors for all stream
types, all these streams would end up destructing the same borrowed
stream. This won't happen with (1), because there will be 1 owner, so
only 1 call to the destructor.

Anybody who has a better idea than svn_stream_wrap_borrowed_ref() or
svn_stream_wrap() ?

bye,

Erik.
Received on Thu Dec 15 23:52:40 2005

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.