r620: revamped thread-local memory management

* Don't preallocate sdust_buf or minizer list. kalloc should be fast enough -
  benchmarks needed to confirm.

* Fixed a memory leak caused by divergence estimate (post v2.5)

* Reset the kalloc buffer after mapping a long query. This reduces peak memory
  when large chunks of memory are allocated, at the cost of performance, though.
This commit is contained in:
Heng Li
2017-12-11 12:11:10 -05:00
parent 98a6e52c06
commit f6608fe99c
6 changed files with 64 additions and 53 deletions
+1
View File
@@ -56,6 +56,7 @@ sdust_buf_t *sdust_buf_init(void *km)
buf = (sdust_buf_t*)kcalloc(km, 1, sizeof(sdust_buf_t));
buf->km = km;
buf->w = kdq_init(int, buf->km);
kdq_resize(int, buf->w, 250);
return buf;
}