git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.

Previous: Jonathan Nieder
Message 5 of 5 in “What's cooking in git.git (Oct 2011, #11; Fri, 28)”
  1. Junio C HamanoOct 28, 2011
  2. Erik Faye-LundOct 29, 2011
  3. Johannes SixtOct 30, 2011
  4. jc/lookup-object-hash from pu crashes on ARMJonathan Nieder, Oct 31, 2011
  5. Junio C HamanoOct 31, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.