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

Re: svn commit: rev 1267 - trunk/subversion/include trunk/subversion/libsvn_subr

From: Branko Čibej <brane_at_xbc.nu>
Date: 2002-02-14 01:01:22 CET

Greg Stein wrote:

>On Wed, Feb 13, 2002 at 04:45:14PM -0600, brane@tigris.org wrote:
>
>>...
>>+/* XXX FIXME: These should be protected by a thread mutex.
>>+ svn_error__locate and make_error_internal should cooperate
>>+ in locking and unlocking it. */
>>+static const char *error_file = NULL;
>>+static long error_line = -1;
>>+void
>>+svn_error__locate (const char *file, long line)
>>+{
>>+#ifdef SVN_DEBUG
>>+ /* XXX TODO: Lock mutex here */
>>+ error_file = file;
>>+ error_line = line;
>>+#endif
>>+}
>>
>
>Woah!
>
>Why don't we just pass these values into the functions. I'd *much* prefer
>that over this global variable hackage...
>
So would I ...

>The createf() thing?
>

Exactly. I've written a fair number of magical debugging macros, but try
as I might, I couldn't find a neat way to elegnatly wrap ...createf
without using C99 varargs macros, or changing every use of that function
throughout the code.

Then I said to myself:

    * this only gets used with --enable-maintainer-mode;
    * the error creation and wrapping functions are not, and never will
      be, performance critical.

So I decided we can live with these global vars, and with the to-be-done
locking.

Notice that I did take care to maintain binary compatibility between
debug and non-debug versions, just like with the pools functions.

-- 
Brane Čibej   <brane_at_xbc.nu>   http://www.xbc.nu/brane/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:37:07 2006

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.