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

Re: svn commit: r39635 - in trunk/subversion/bindings/swig: . include python/libsvn_swig_py

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: Thu, 01 Oct 2009 18:23:14 +0100

On Thu, 2009-10-01 at 18:17 +0100, Stefan Sperling wrote:
> On Thu, Oct 01, 2009 at 06:11:48PM +0100, Julian Foad wrote:
> > Stefan Sperling wrote:
> > > > + APR_ARRAY_IDX(temp, targlen, void *) = struct_ptr;
> > >
> > > You could use APR_ARRAY_PUSH(temp, void *) = struct_ptr; here.
> > > That would align better with common use of arrays in our code,
> > > PUSH is usually used for writing to the array, IDX for retrieval.
> >
> > No, PUSH is different: it means extend the array by one element and then
> > set that element.
>
> Oh! Right, then I was mistaken. So in this case, PUSH would only be
> appropriate if the array was created with 0 elements initially.

Ahh... I guess that explains the initial "temp->nelts = targlen;" that
you queried. APR doc strings aren't clear on whether "apr_array_make"
sets nelts to the given value or just determines the amount of memory
allocated.

- Julian

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2402622
Received on 2009-10-01 19:23:28 CEST

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.