summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: eeefa7c)
raw | patch | inline | side by side (parent: eeefa7c)
author | Junio C Hamano <gitster@pobox.com> | |
Tue, 1 Sep 2009 09:18:52 +0000 (02:18 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 1 Sep 2009 14:55:56 +0000 (07:55 -0700) |
This is one of only two places that we use C99 variable length array on
the stack, which some older compilers apparently are not happy with.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
the stack, which some older compilers apparently are not happy with.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-pack-objects.c | patch | blob | history |
diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index c918d4bfc4859e19ec7000e21f8b9380c305a8b9..1ff2ce6df4b5efc58612b7fe6d5877319f17724a 100644 (file)
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
static void ll_find_deltas(struct object_entry **list, unsigned list_size,
int window, int depth, unsigned *processed)
{
- struct thread_params p[delta_search_threads];
+ struct thread_params *p;
int i, ret, active_threads = 0;
if (delta_search_threads <= 1) {
if (progress > pack_to_stdout)
fprintf(stderr, "Delta compression using up to %d threads.\n",
delta_search_threads);
+ p = xcalloc(delta_search_threads, sizeof(*p));
/* Partition the work amongst work threads. */
for (i = 0; i < delta_search_threads; i++) {
active_threads--;
}
}
+ free(p);
}
#else