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

svn_utf_initialize and pool cleanup

From: Greg Hudson <ghudson_at_MIT.EDU>
Date: 2004-09-06 20:49:35 CEST

The signature of our UTF-8 initialization hack is:

  void svn_utf_initialize (void)

Peter initially had it take a pool argument, but then changed it to
allocate a subpool of the global pool, and made it clean up the xlate
handle at apr_terminate() time.

My concern here is that if someone dynamically loads the Subversion
libraries and then unloads them, this pool will be leaked each time
(unless the application initializes and terminates APR on each load,
but that's not a fair assumption to make, since the application might
be using APR for other reasons).

So I do think we want to be passing a pool argument to
svn_utf_initialize(), with the proviso that no Subversion functions
may be in progress when this pool is cleaned up. The pool cleanup
handler can reset the static data so that we go back to per-pool xlate
handles.

Speaking of which, it looks like Peter's code doesn't use per-pool
xlate handles when svn_utf_initialize() is called, which means his
change makes translation much *slower* if the initializer isn't
called. That doesn't seem acceptable.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Sep 6 20:49:55 2004

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.