summaryrefslogtreecommitdiffstats
path: root/arith.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-08-17 21:53:10 -0700
committerKaz Kylheku <kaz@kylheku.com>2017-08-17 21:53:10 -0700
commit25a3e10e7aed58c8745fdadc87b3b26e8b51523e (patch)
tree1cbe9b70c318f8406c4dbe92c4213218f24487a0 /arith.c
parent49fa1df6a448459279cfcaa98f26f9d0d584a8ff (diff)
downloadtxr-25a3e10e7aed58c8745fdadc87b3b26e8b51523e.tar.gz
txr-25a3e10e7aed58c8745fdadc87b3b26e8b51523e.tar.bz2
txr-25a3e10e7aed58c8745fdadc87b3b26e8b51523e.zip
Rewriting string-extend.
* lib.c (string_extend): Restructure internals with these goals: no loop: calculate needed space in one step; if the allocation needs to grow, then grow it by 25% or step it up to exactly the needed size, whichever of the two is larger. Overflow check against INT_PTR_MAX, since len and alloc fields of string are not fixnums but integers extracted with c_num.
Diffstat (limited to 'arith.c')
0 files changed, 0 insertions, 0 deletions