[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: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Wed, 14 Oct 2009 09:50:45 +0200 (Jerusalem Standard Time)

Branko Cibej wrote on Wed, 14 Oct 2009 at 06:41 +0200:
> Daniel Shahaf wrote:
> > 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:
> >>> + apr_hash_set(records, key, sizeof(*key), value);
> >>>
> >> Is it legit to hash on a struct? Couldn't there be padding bytes?
> >>
> >
> > While this doesn't answer the question, we have precedent in
> > libsvn_fs_base/bdb/env.c:
>
> ... but notice that bdb_env_key_t is part of bdb_env_t which has a
> constructor called create_env() that uses calloc() to allocate the
> struct. Yes, there can be padding, and yes, using (apr_p)calloc to
> allocate the struct avoids hashing random padding bits.
>

Good to know. Fixed in r40006, thanks.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2407439
Received on 2009-10-14 09:51:09 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.