r1089: fixed an unusual memory leak (#749)
This is more apparent when there are many candidate chains. Although only a small numbers of them are extended, they are still occupying memory. A realloc() solves this problem. This is a long existiing issue.
This commit is contained in:
parent
629c11728e
commit
2392e54fe2
2
main.c
2
main.c
|
|
@ -7,7 +7,7 @@
|
|||
#include "mmpriv.h"
|
||||
#include "ketopt.h"
|
||||
|
||||
#define MM_VERSION "2.21-dev-r1087-dirty"
|
||||
#define MM_VERSION "2.21-dev-r1089-dirty"
|
||||
|
||||
#ifdef __linux__
|
||||
#include <sys/resource.h>
|
||||
|
|
|
|||
1
map.c
1
map.c
|
|
@ -336,6 +336,7 @@ void mm_map_frag(const mm_idx_t *mi, int n_segs, const int *qlens, const char **
|
|||
|
||||
if (n_segs == 1) { // uni-segment
|
||||
regs0 = align_regs(opt, mi, b->km, qlens[0], seqs[0], &n_regs0, regs0, a);
|
||||
regs0 = (mm_reg1_t*)realloc(regs0, sizeof(*regs0) * n_regs0);
|
||||
mm_set_mapq(b->km, n_regs0, regs0, opt->min_chain_score, opt->a, rep_len, is_sr);
|
||||
n_regs[0] = n_regs0, regs[0] = regs0;
|
||||
} else { // multi-segment
|
||||
|
|
|
|||
Loading…
Reference in New Issue