Commit 93bba072c2b45bc5879500248f203610dfa1405b

Stefan Sperling 2020-03-18T16:13:46

use qsort(3) instead of mergesort(3) to avoid a large spike in memory usage

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/libexec/got-index-pack/got-index-pack.c b/libexec/got-index-pack/got-index-pack.c
index 6d9aba3..9ebc198 100644
--- a/libexec/got-index-pack/got-index-pack.c
+++ b/libexec/got-index-pack/got-index-pack.c
@@ -511,7 +511,7 @@ make_packidx(struct got_packidx *packidx, int nobj,
 	int i;
 	uint32_t idx = 0;
 
-	mergesort(objects, nobj, sizeof(struct got_indexed_object),
+	qsort(objects, nobj, sizeof(struct got_indexed_object),
 	    indexed_obj_cmp);
 
 	memset(packidx->hdr.fanout_table, 0,