Re: [PATCH] hex.c: reduce memory footprint of sha1_to_hex static buffers

2015-02-13 Thread Junio C Hamano
Stefan Beller sbel...@google.com writes: 41 bytes is the exact number of bytes needed for having the returned hex string represented. 50 seems to be an arbitrary number, such that there are no benefits from alignment to certain address boundaries. Yes, with s/seems to be/is/; This comes from

Re: [PATCH] hex.c: reduce memory footprint of sha1_to_hex static buffers

2015-02-13 Thread Linus Torvalds
On Fri, Feb 13, 2015 at 1:56 PM, Stefan Beller sbel...@google.com wrote: As I could not find any documentation on the magical 50 in the early days, I cc'd Linus in case there is something I did not think of yet. Nothing magical, it's just rounded up from 40 + NUL character.

Re: [PATCH] hex.c: reduce memory footprint of sha1_to_hex static buffers

2015-02-13 Thread Stefan Beller
On Fri, Feb 13, 2015 at 1:41 PM, Junio C Hamano gits...@pobox.com wrote: Stefan Beller sbel...@google.com writes: 41 bytes is the exact number of bytes needed for having the returned hex string represented. 50 seems to be an arbitrary number, such that there are no benefits from alignment to

[PATCH] hex.c: reduce memory footprint of sha1_to_hex static buffers

2015-02-13 Thread Stefan Beller
41 bytes is the exact number of bytes needed for having the returned hex string represented. 50 seems to be an arbitrary number, such that there are no benefits from alignment to certain address boundaries. Signed-off-by: Stefan Beller sbel...@google.com --- hex.c | 2 +- 1 file changed, 1

Re: [PATCH] hex.c: reduce memory footprint of sha1_to_hex static buffers

2015-02-13 Thread Junio C Hamano
Stefan Beller sbel...@google.com writes: On Fri, Feb 13, 2015 at 1:41 PM, Junio C Hamano gits...@pobox.com wrote: Stefan Beller sbel...@google.com writes: 41 bytes is the exact number of bytes needed for having the returned hex string represented. 50 seems to be an arbitrary number, such