git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH/RFC 4/6] object: add one bit to let creation of private types  (OBJ_MAX + n)
@ 2009-02-22 18:06 Marc-André Lureau
  2009-02-22 18:21 ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Marc-André Lureau @ 2009-02-22 18:06 UTC (permalink / raw)
  To: git

---
 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

 /*
-- 
1.6.2.rc1.28.g05ef4.dirty

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH/RFC 4/6] object: add one bit to let creation of private types  (OBJ_MAX + n)
  2009-02-22 18:06 [PATCH/RFC 4/6] object: add one bit to let creation of private types (OBJ_MAX + n) Marc-André Lureau
@ 2009-02-22 18:21 ` Junio C Hamano
  2009-02-22 18:35   ` Marc-André Lureau
  0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2009-02-22 18:21 UTC (permalink / raw)
  To: Marc-André Lureau; +Cc: git

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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH/RFC 4/6] object: add one bit to let creation of private  types (OBJ_MAX + n)
  2009-02-22 18:21 ` Junio C Hamano
@ 2009-02-22 18:35   ` Marc-André Lureau
  2009-02-23  1:47     ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Marc-André Lureau @ 2009-02-22 18:35 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Hi

On Sun, Feb 22, 2009 at 8:21 PM, Junio C Hamano <gitster@pobox.com> wrote:
> 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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH/RFC 4/6] object: add one bit to let creation of private  types (OBJ_MAX + n)
  2009-02-22 18:35   ` Marc-André Lureau
@ 2009-02-23  1:47     ` Junio C Hamano
  0 siblings, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2009-02-23  1:47 UTC (permalink / raw)
  To: Marc-André Lureau; +Cc: git

Marc-André Lureau <marcandre.lureau@gmail.com> writes:

> 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?

My preference is, as was indicated in my reply to 5/6, the latter.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-02-23  1:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-22 18:06 [PATCH/RFC 4/6] object: add one bit to let creation of private types (OBJ_MAX + n) Marc-André Lureau
2009-02-22 18:21 ` Junio C Hamano
2009-02-22 18:35   ` Marc-André Lureau
2009-02-23  1:47     ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).