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

Re: Pool usage

From: C. Michael Pilato <cmpilato_at_collab.net>
Date: 2004-05-23 17:38:37 CEST

"Peter N. Lundblad" <peter@famlundblad.se> writes:

> hash table. The pool should live longer than the temporary string used by
> svn_cmdline_fprintf, but I still wonder if this is considered correct or
> if I should use a subpool.

Make a subpool of hash_pool, use it for your fprintf()'s (and also for
this block, too, please):

      for (hi = apr_hash_first (hash_pool, rb->props);
           hi;
           hi = apr_hash_next (hi))

And then destroy it before exiting the function.

That way the only use of the hash_pool itself is when we are
allocating stuff that gets stored back into the hash itself.

Additinally:

> Index: main.c
> ===================================================================
> --- main.c (revision 9862)
> +++ main.c (arbetskopia)
> @@ -636,15 +636,17 @@
> SVN_ERR (svn_stream_write (rb->pb->out_stream,
> rb->body->data , &(rb->body->len)));
> if (! rb->pb->quiet)
> - fprintf (stderr, _("Revision %ld committed as %ld.\n"),
> - rb->rev_orig, rb->rev_actual);
> + SVN_ERR (svn_cmdline_fprintf (stderr, hash_pool,
> + _("Revision %ld committed as %ld.\n"),
> + rb->rev_orig, rb->rev_actual));

Indentation is busted here ^^^.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun May 23 17:39:13 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.