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

Re: [PATCH/RFC 4/6] object: add one bit to let creation of private types (OBJ_MAX + n)

From
Marc-André Lureau <marcandre.lureau@gmail.com>
Date
Feb 22, 2009, 18:35 UTC
Message-ID
<e29894ca0902221035s54e005adg586409754966cfcc@mail.gmail.com>
In-Reply-To
<7vocwuxrgb.fsf@gitster.siamese.dyndns.org>
Hi
On Sun, Feb 22, 2009 at 8:21 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 23 quoted lines
> Marc-André Lureau <marcandre.lureau@gmail.com> writes:
>
>> ---
>>  object.h |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/object.h b/object.h
>> index 89dd0c4..83d3644 100644
>> --- a/object.h
>> +++ b/object.h
>> @@ -21,7 +21,7 @@ struct object_array {
>>       } *objects;
>>  };
>>
>> -#define TYPE_BITS   3
>> +#define TYPE_BITS   4
>>  #define FLAG_BITS  27
>
> This would increase the value of (TYPE_BITS+FLAG_BITS).  We spent a lot of
> effect to keep sizeof(struct object) to absolute minimum, and you need to
> have a very good reason if you are breaking it.
>
>

Ooops. Ok, I should try to think harder how to have my own tag_list. I only store a struct tag or a struct light_tag currently.

One option is to reuse the struct tag, by adding a "light" flag, but I am not fond of this idea.

Second option is to create a custom tag list in builtin-tag.c, not reusing object_list. I guess this is better then. What do you think?

For example:
struct tag_list {
 struct object *item;
 int light; /* item is a struct light_tag */
 struct object_list *next;
}
thanks,
-- 
Marc-André Lureau
Sent from: Helsinki Southern Finland Finland.
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 4 in “object: add one bit to let creation of private types (OBJ_MAX + n)”
  1. 4/6 object: add one bit to let creation of private types (OBJ_MAX + n)Marc-André Lureau, Feb 22, 2009
  2. Junio C HamanoFeb 22, 2009
  3. Marc-André LureauFeb 22, 2009
  4. Junio C HamanoFeb 23, 2009

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.