summaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2022-01-03 17:33:50 +0100
committerJo-Philipp Wich <jo@mein.io>2022-01-04 16:20:23 +0100
commit2fd7ab5f73048f3363c05a614dc3362a816af237 (patch)
tree85c2e4b329f327c1058efa1612c30f4726816292 /tests
parent5bb9ab77945ec429a4bdf9b5d317237d7619f8cc (diff)
vm: optimize string concatenation
When concatenating strings, avoid allocating three times the required memory in the worst case. Instead of first allocating the string representations of the operands followed by the memory for the final string, allocate a string buffer and print the operands into it. This will grow the target memory as needed and avoid redundant internal copies of the involved strings. Also handle the special where the final string fits into a tagged pointer and deal with it accordingly. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'tests')
0 files changed, 0 insertions, 0 deletions