Re: jc/lookup-object-hash from pu crashes on ARM
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 31, 2011, 20:28 UTC
- Message-ID
- <7vhb2oq521.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <20111031125648.GA1757@elie.hsd1.il.comcast.net>
Jonathan Nieder <jrnieder@gmail.com> writes:
Show 10 quoted lines
> Even better could be to start aligning the hashes we pass around,
> using something like this:
>
> union object_hash {
> unsigned char sha1[20];
> uint32_t chunk[5];
> };
>
> which could speed up functions like hashcpy(), hashcmp(), and
> hasheq(). But it's probably not worth the fuss.The "flag" field in struct ref_list should be moved down to assure alignment.
struct ref_list {
struct ref_list *next;
unsigned char flag; /* ISSYMREF? ISPACKED? */
unsigned char sha1[20];
unsigned char peeled[20];
char name[FLEX_ARRAY];
};I am very tempted to take that "union" approach (modulo that I would call that an "object_name") in the longer run, though.