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

Re: What's cooking in git.git (Dec 2013, #02; Fri, 6)

From
Karsten Blees <karsten.blees@gmail.com>
Date
Dec 18, 2013, 14:12 UTC
Message-ID
<52B1AD66.4000507@gmail.com>
In-Reply-To
<52A5CDB0.2020206@gmail.com>
Am 09.12.2013 15:03, schrieb Karsten Blees:
Show 12 quoted lines
> 3.) Inject individual fields via macro
> 
> Instead of injecting a struct hashmap_entry, which implies alignment to sizeof(struct hashmap_entry), we could inject the individual fields, e.g.
> 
>  #define HASHMAP_ENTRY_HEADER struct hashmap_entry __next; unsinged int __hash;
> 
>  struct name_entry {
>    HASHMAP_ENTRY_HEADER
>    int namelen;
>    char *name;
>  };
> 
I've tried this as well. However, the change is much more intrusive, and produces lots of strict-aliasing warnings in GCC 4.4, probably due to this bug [1]. So I don't think its a good solution. For anyone interested, the patch can be found at [2].

[1] http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42032 [2] https://github.com/kblees/git/commits/kb/hashmap-v5-fixes-macro

Previous: Karsten BleesNext: Junio C Hamano
Message 19 of 23 in “What's cooking in git.git (Dec 2013, #02; Fri, 6)”
  1. Junio C HamanoDec 6, 2013
  2. Felipe ContrerasDec 7, 2013
  3. Felipe ContrerasDec 7, 2013
  4. Junio C HamanoDec 9, 2013
  5. Thomas RastDec 7, 2013
  6. Jeff KingDec 9, 2013
  7. Junio C HamanoDec 9, 2013
  8. Matthieu MoyDec 7, 2013
  9. Karsten BleesDec 7, 2013
  10. Thomas RastDec 7, 2013
  11. Karsten BleesDec 7, 2013
  12. Thomas RastDec 8, 2013
  13. Karsten BleesDec 9, 2013
  14. Jonathan NiederDec 9, 2013
  15. Karsten BleesDec 9, 2013
  16. Jonathan NiederDec 9, 2013
  17. Karsten BleesDec 18, 2013
  18. Karsten BleesDec 18, 2013
  19. Karsten BleesDec 18, 2013
  20. Junio C HamanoDec 9, 2013
  21. Junio C HamanoDec 9, 2013
  22. hashmap.h: Use 'unsigned int' for hash-codes everywhereKarsten Blees, Dec 18, 2013
  23. Junio C HamanoDec 18, 2013

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.