Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: git@vger.kernel.org
Subject: Re: sha1_to_hex() usage cleanup
Date: Wed, 03 May 2006 17:36:57 -0700	[thread overview]
Message-ID: <7v1wvabp7a.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <Pine.LNX.4.64.0605031717190.4086@g5.osdl.org> (Linus Torvalds's message of "Wed, 3 May 2006 17:21:08 -0700 (PDT)")

Linus Torvalds <torvalds@osdl.org> writes:

> Somebody on the #git channel complained that the sha1_to_hex() thing uses 
> a static buffer which caused an error message to show the same hex output 
> twice instead of showing two different ones.
>
> That's pretty easily rectified by making it uses a simple LRU of a few 
> buffers, which also allows some other users (that were aware of the buffer 
> re-use) to be written in a more straightforward manner.
>
> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
> ---
>
> This is another throw-away patch of mine. Not a big deal, but since I 
> tried it, I might as well try to submit it and see if Junio agrees..

Makes sort of sense in that the callers still need to be aware
of the magic 4 limit but as long as they are they do not have to
worry about allocation/deallocation/copying.  But is that kind
of cheat maintainable?  I dunno.

  reply	other threads:[~2006-05-04  0:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-04  0:21 sha1_to_hex() usage cleanup Linus Torvalds
2006-05-04  0:36 ` Junio C Hamano [this message]
2006-05-04  1:27   ` 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=7v1wvabp7a.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=git@vger.kernel.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