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

Re: [PATCH][MERGE-TRACKING] New function to create a mergeinfo hash out of a single path and single merge-range

From: Malcolm Rowe <malcolm-svn-dev_at_farside.org.uk>
Date: 2006-10-10 12:21:46 CEST

On Tue, Oct 10, 2006 at 02:48:47PM +0530, Kamesh Jayachandran wrote:
> >+ svn_merge_range_t *range = apr_palloc(pool, sizeof(*range));
> >
> I feel
>
> - svn_merge_range_t *range = apr_palloc(pool, sizeof(*range));
> + svn_merge_range_t *range = apr_palloc(pool, sizeof(svn_merge_range_t));
>
> more clearer.
>

We already use the former pattern pretty-much exclusively. It has the
advantage that you only need to give the type once, so that the
allocation can never get out of step with the definition. For example,
if we were to create an svn_merge_range2_t type, we might change the
definition of 'range' but forget to change the argument to sizeof().

Regards,
Malcolm

  • application/pgp-signature attachment: stored
Received on Tue Oct 10 12:26:01 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.