From: Philip Pokorny <ppokorny@mindspring.com>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Junio C Hamano <junkio@cox.net>, Git Mailing List <git@vger.kernel.org>
Subject: Re: Shrink "struct object" a bit
Date: Sat, 17 Jun 2006 08:36:22 -0700 [thread overview]
Message-ID: <44942176.1070107@mindspring.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0606141630570.5498@g5.osdl.org>
Linus Torvalds wrote:
>This shrinks "struct object" by a small amount, by getting rid of the
>"struct type *" pointer and replacing it with a 3-bit bitfield instead.
>
>@@ -179,9 +179,7 @@ static int loop(void)
> */
> if (! (obj->flags & TO_SCAN)) {
> if (fetch(obj->sha1)) {
>- report_missing(obj->type
>- ? obj->type
>- : "object", obj->sha1);
>+ report_missing(typename(obj->type), obj->sha1);
> return -1;
> }
> }
>
>
>diff --git a/object.c b/object.c
>index 9adc874..0f70890 100644
>--- a/object.c
>+++ b/object.c
>@@ -9,6 +9,10 @@ struct object **objs;
> static int nr_objs;
> int obj_allocs;
>
>+const char *type_names[] = {
>+ "none", "blob", "tree", "commit", "bad"
>+};
>+
>
>
A minor thing, but doesn't this mean the "report_missing" message would
change from:
> Cannot obtain needed object ab12cdef1234567890abcd
> while processing commit fedcbadeadbeefdeadbe
to
> Cannot obtain needed none ab12cdef1234567890abcd
> while processing commit fedcbadeadbeefdeadbe
in some cases? I'm not sure that it's possible for the type value to be
unspecified at this point in the code, but it seemed like the output
from report_missing would be confusing if this ever happened.
:v)
next prev parent reply other threads:[~2006-06-17 15:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-14 23:45 Shrink "struct object" a bit Linus Torvalds
2006-06-17 15:36 ` Philip Pokorny [this message]
2006-06-17 19:13 ` Linus Torvalds
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=44942176.1070107@mindspring.com \
--to=ppokorny@mindspring.com \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).