Skip to content

pack-objects: use ALLOC_GROW in place of manual growth

Jonathan Nieder git 1 version In review

Get series with b4
b4 am 20101008164536.GB9212@burratino

Versions newest first

  1. v1 Latest2 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2Documentation: No argument of ALLOC_GROW should have side-effectscache.h+1 -10 replies
2/2pack-objects: use ALLOC_GROWbuiltin/pack-objects.c+4 -110 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] pack-objects: use ALLOC_GROW in place of manual growth

Review

Quoted 4 lines · Jonathan Nieder
(quoted diff) +3 -1
-	done_pbase_paths_num++;
+	ALLOC_GROW(done_pbase_paths,
+		   ++done_pbase_paths_num,
+		   done_pbase_paths_alloc);

Junio noticed that this makes done_pbase_paths_num grow by 3 rather than by 1 as intended. Sorry.

Patch 1 corrects some documentation that could lead one astray. Patch 2 is a corrected patch that uses ALLOC_GROW correctly (I hope).

Jonathan Nieder (2):
Documentation: No argument of ALLOC_GROW cannot have side-effects
pack-objects: use ALLOC_GROW

 builtin/pack-objects.c |   15 ++++-----------
 cache.h                |    2 +-
 2 files changed, 5 insertions(+), 12 deletions(-)
Signature · 1 line
1.7.2.3