mirror of
https://github.com/lh3/minimap2.git
synced 2026-09-24 01:08:11 +08:00
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:
@@ -189,6 +189,10 @@ void km_stat(const void *_km, km_stat_t *s)
|
||||
panic("[km_stat] The end of a free block enters another free block.");
|
||||
if (p->ptr == km->loop_head) break;
|
||||
}
|
||||
for (p = km->core_head; p != NULL; p = p->ptr)
|
||||
++s->n_cores, s->capacity += p->size * sizeof(header_t);
|
||||
for (p = km->core_head; p != NULL; p = p->ptr) {
|
||||
size_t size = p->size * sizeof(header_t);
|
||||
++s->n_cores;
|
||||
s->capacity += size;
|
||||
s->largest = s->largest > size? s->largest : size;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user