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

Re: Guaranteeing memory pool lifetime

From: Greg Hudson <ghudson_at_MIT.EDU>
Date: 2005-07-05 22:18:11 CEST

On Tue, 2005-07-05 at 20:41 +0100, Matthew Hambley wrote:
> > And how would you access the same map in subsequent calls?
>
> Hold the hash as a static variable and call the function which contained it
> to retrieve the pointer.

Static variables are not thread-safe, and we cannot protect them with a
mutex because we do not have statically initialized mutexes. We went
through this issue with character-set mappings and wound up with a new
function svn_utf_initialize() and poor performance if you don't call it.

The right answer is to create a context for MIME type mappings and make
the calling code pass the context to the guessing functions. We
couldn't do that for character set translations because it would have
required churning almost our entire code base, but MIME type guessing is
probably only done in a few places.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Jul 5 22:33:24 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.