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

Re: [PATCH] dup function for svn_info_t

From: Chris Foote <cfoote_at_v21.me.uk>
Date: 2005-06-13 01:09:12 CEST

Branko Čibej wrote:
> Chris Foote wrote:
>
> >[LOG]
> >
> >Add a function to duplicate the svn_info_t structure.
> >
> >* subversion/include/svn_client.h
> > (svn_info_t): Add note to update svn_info_dup when extending the struct.
> > (svn_info_dup): New function to duplicate an svn_info_t.
> >
> >* subversion/libsvn_client/info.c
> > (svn_info_dup): Ditto.
> >
> >
> Why add a public function that's not used anywhere?
>
So that clients (i.e. one I'm writing) can create safe copies of the struct
that are allocated in a different pool from the one that was used when
calling svn_client_info.

> >+svn_info_t *
> >+svn_info_dup (const svn_info_t *info, apr_pool_t *pool)
> >+{
> >+ svn_info_t *dupinfo = apr_pcalloc (pool, sizeof(*dupinfo));
> >+
> >+ /* Perform a trivial copy ... */
> >+ *dupinfo = *info;
> >
> >
> Since you're copying the struct anyway, there's no sense in using
> apr_pcalloc.
True, although this is what svn_wc_entry_dup uses.

Chris

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Jun 13 01:10:11 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.