summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4234a76)
raw | patch | inline | side by side (parent: 4234a76)
author | Jeff King <peff@peff.net> | |
Sat, 16 Jun 2007 22:37:39 +0000 (18:37 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 17 Jun 2007 00:55:44 +0000 (17:55 -0700) |
The ALLOC_GROW macro will never let us fill the array completely,
instead allocating an extra chunk if that would be the case. This is
because the 'nr' argument was originally treated as "how much we do have
now" instead of "how much do we want". The latter makes much more
sense because you can grow by more than one item.
This off-by-one never resulted in an error because it meant we were
overly conservative about when to allocate. Any callers which passed
"how much we have now" need to be updated, or they will fail to allocate
enough.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
instead allocating an extra chunk if that would be the case. This is
because the 'nr' argument was originally treated as "how much we do have
now" instead of "how much do we want". The latter makes much more
sense because you can grow by more than one item.
This off-by-one never resulted in an error because it meant we were
overly conservative about when to allocate. Any callers which passed
"how much we have now" need to be updated, or they will fail to allocate
enough.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
cache.h | patch | blob | history |