diff options
| author | Roland Paterson-Jones <[email protected]> | 2024-10-16 08:56:38 +0200 |
|---|---|---|
| committer | Quentin Carbonneaux <[email protected]> | 2025-03-14 09:47:05 +0100 |
| commit | c16f7eafcae4a35d1be8c071760198f787bc9aef (patch) | |
| tree | 7494ed2725ff1d97289eb9e6bbab02b1447ba6aa | |
| parent | 327736b3a6e77b201fffebd3cc207662e823d3a5 (diff) | |
Fn::rpo is a vector
Scratching an itch - avoid unnecesary re-allocation in fillrpo()
which is called multiple times in the optimisation chain.
| -rw-r--r-- | cfg.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -108,7 +108,10 @@ fillrpo(Fn *f) b->id = -1u; n = 1 + rporec(f->start, f->nblk-1); f->nblk -= n; - f->rpo = alloc(f->nblk * sizeof f->rpo[0]); + if (f->rpo) + vgrow(&f->rpo, f->nblk); + else + f->rpo = vnew(f->nblk, sizeof f->rpo[0], PFn); for (p=&f->start; (b=*p);) { if (b->id == -1u) { edgedel(b, &b->s1); |
