Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2014-09-16 22:56:48 +0400
committerJunio C Hamano <gitster@pobox.com>2014-09-18 20:13:38 +0400
commit3ac22f82edec108986b2627fcd6f2a8039617a23 (patch)
tree91f4cd65a867a4808d731e61e63b90d2abbea29e /sh-i18n--envsubst.c
parentce1d3a93a6405b8a0313491df3099919ed3d150f (diff)
add macro REALLOC_ARRAY
The macro ALLOC_GROW manages several aspects of dynamic memory allocations for arrays: It performs overprovisioning in order to avoid reallocations in future calls, updates the allocation size variable, multiplies the item size and thus allows users to simply specify the item count, performs the reallocation and updates the array pointer. Sometimes this is too much. Add the macro REALLOC_ARRAY, which only takes care of the latter three points and allows users to specfiy the number of items the array can store. It can increase and also decrease the size. Using the macro avoid duplicating the variable name and takes care of the item sizes automatically. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sh-i18n--envsubst.c')
0 files changed, 0 insertions, 0 deletions