Re: [PATCH] factorize pack structure allocation

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Andreas Ericsson
Date: Wednesday, June 25, 2008 - 11:40 pm

Nicolas Pitre wrote:

Minor nit; Use xcalloc() instead. It initializes the allocated area
to zero by default, either by the glibc allocator when it re-uses old
memory, or by the kernel when it's handed to userspace. It's a
micro-optimization, but a worthwhile one imo, especially for repos
with lots and lots of packs (git gc --auto runs galore).

The "calloc() returns nulified memory" dogma conforms to C89 and is
thus about as portable as it gets.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] factorize pack structure allocation, Nicolas Pitre, (Tue Jun 24, 3:58 pm)
Re: [PATCH] factorize pack structure allocation, Jon Loeliger, (Tue Jun 24, 4:13 pm)
Re: [PATCH] factorize pack structure allocation, Teemu Likonen, (Wed Jun 25, 12:19 am)
Re: [PATCH] factorize pack structure allocation, Andreas Ericsson, (Wed Jun 25, 11:40 pm)