threads / rfc / 17956

RFC patch, 6 partsobject: add one bit to let creation of private types (OBJ_MAX + n)

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

## tl;dr

4 messages between Feb 22, 2009 and Feb 23, 2009. Diffs are folded; open one to read it.

replies: 3people: 2as markdown or json

Marc-André Lureau· Feb 22, 2009, 18:06 UTC · lore
---
 object.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Show changes to object.h +1 −1
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
Junio C Hamano· Feb 22, 2009, 18:21 UTC · re: Marc-André Lureau · lore

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

Marc-André Lureau <marcandre.lureau@gmail.com> writes:
Show 15 quoted lines
> ---
>  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.

Marc-André Lureau· Feb 22, 2009, 18:35 UTC · re: Junio C Hamano · lore

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

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.
Junio C Hamano· Feb 23, 2009, 01:47 UTC · re: Marc-André Lureau · lore

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

Marc-André Lureau <marcandre.lureau@gmail.com> writes:
Show 5 quoted lines
> 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.

← back to recent threads