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

Re: svn commit: r39997 - trunk/tools/server-side

From: David Glasser <glasser_at_davidglasser.net>
Date: Tue, 13 Oct 2009 17:15:40 -0700

On Tue, Oct 13, 2009 at 1:07 PM, Daniel Shahaf <d.s_at_daniel.shahaf.name> wrote:
> Daniel Shahaf wrote on Tue, 13 Oct 2009 at 22:03 +0200:
>> David Glasser wrote on Tue, 13 Oct 2009 at 12:45 -0700:
>> > On Oct 13, 2009 12:27 PM, "Daniel Shahaf" <tigris_at_danielsh.fastmail.net>
>> > wrote:
>> >
>> > > +struct key_t
>> > > +{
>> > > +  svn_revnum_t revision;
>> > > +  apr_off_t offset;
>> > > +};
>> > > +
>> > > +/* What we need to know about a rep. */
>> > > +struct value_t
>> > > +{
>> > > +  svn_checksum_t *sha1_checksum;
>> > > +  apr_uint64_t refcount;
>> > > +};
>> ...
>> > > +  apr_hash_set(records, key, sizeof(*key), value);
>> >
>> > Is it legit to hash on a struct? Couldn't there be padding bytes?
>
> Should I use apr_pcalloc() to allocate the key_t structs?

Hmm, that would probably be fine.

While you're at it, maybe you want to check that the shas match when
you're incrementing the reccount?

--dave

-- 
glasser_at_davidglasser.net | langtonlabs.org | flickr.com/photos/glasser/
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2407366
Received on 2009-10-14 02:16:11 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.