diff options
| author | Roland Paterson-Jones <[email protected]> | 2024-10-22 14:22:49 +0200 |
|---|---|---|
| committer | Quentin Carbonneaux <[email protected]> | 2025-03-14 09:47:05 +0100 |
| commit | ca928f6f8d18b4cf3acd1dd4b7443a5631c06af2 (patch) | |
| tree | 9eedbe65cc60f271a3ec12623b36cbcd68117815 /util.c | |
| parent | 024dffac8bbfa709ed3aed53d14b235e67047490 (diff) | |
Blk::ins is a vector
Scratching an itch - avoid unnecesary re-allocation in idup()
which is called often in the optimisation chain.
Blk::ins is reallocated in xxx_abi() - needs further fiddling.
Diffstat (limited to 'util.c')
| -rw-r--r-- | util.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -255,7 +255,10 @@ emiti(Ins i) void idup(Ins **pd, Ins *s, ulong n) { - *pd = alloc(n * sizeof(Ins)); + if (*pd) + vgrow(pd, n); + else + *pd = vnew(n, sizeof(Ins), PFn); if (n) memcpy(*pd, s, n * sizeof(Ins)); } |
