Malcolm Rowe wrote:
> 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
>
Makes sense, When I looked at it I was wondering from where the 'range'
comes from,(I first looked at args, I could not find one, then happened
to find it at left hand side.)
With regards
Kamesh Jayachandran
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Oct 10 12:29:01 2006