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

Re: [PATCH v2] builtin-fast-export: Add importing and exporting of revision marks

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jun 7, 2008, 15:19 UTC
Message-ID
<alpine.DEB.1.00.0806071612460.1783@racer>
In-Reply-To
<DB158BDE-70D1-4779-9B03-A85C60EB2FA7@ai.rug.nl>
Hi,
On Sat, 7 Jun 2008, Pieter de Bie wrote:
Show 12 quoted lines
> On 7 jun 2008, at 01:09, Junio C Hamano wrote:
> 
> >I am confused.
> >
> >The type of object_decoration.decorattion is a (void*).  Why isn't it
> >sufficient to do it in a naïve and straightforward way?
> >
> > mark = (uint32_t)(deco->decoration);
> >       add_decoration(&idnums, object, (void*) mark);
> >
> >Is this twisted pointer arithmetic done in order to avoid cast between 
> >int and pointer of different size in the code?

Yes, it was done in response to a remark that pointers might not be allowed to be unaligned.

> I'm not sure why this is done; I simply copied what the existing code 
> already did.

Okay, I looked again, and indeed, you _copied_ it. Instead of using the functions mark_object() and get_object_mark() which are there only to be used by you.

So please fix.
> >Even if that is the case, doesn't "(uint32_t *)deco->decoration - 
> >(uint32_t *)NULL" mean the value range for deco->decoration is 
> >one-fourth of U32?

It is. But since every object needs already at least 20 bytes, and we do not even have the complete address space to put objects into, and we do not plan to support 64-bit only repositories, I think we are fine. At least for the moment.

Ciao, Dscho

Previous: Pieter de BieNext: Junio C Hamano
Message 8 of 18 in “builtin-fast-export: Add importing and exporting of revision marks”
  1. builtin-fast-export: Add importing and exporting of revision marksPieter de Bie, Jun 4, 2008
  2. Johannes SchindelinJun 5, 2008
  3. Pieter de BieJun 5, 2008
  4. builtin-fast-export: Add importing and exporting of revision marksPieter de Bie, Jun 5, 2008
  5. Johannes SchindelinJun 5, 2008
  6. Junio C HamanoJun 6, 2008
  7. Pieter de BieJun 7, 2008
  8. Johannes SchindelinJun 7, 2008
  9. Junio C HamanoJun 7, 2008
  10. Johannes SchindelinJun 11, 2008
  11. Documentation/fast-export: Document --import-marks and --export-marks optionsPieter de Bie, Jun 7, 2008
  12. Johannes SchindelinJun 7, 2008
  13. Junio C HamanoJun 10, 2008
  14. builtin-fast-export: Add importing and exporting of revision marksPieter de Bie, Jun 11, 2008
  15. Pieter de BieJun 11, 2008
  16. Johannes SchindelinJun 11, 2008
  17. Junio C HamanoJun 11, 2008
  18. Johannes SchindelinJun 5, 2008

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.