summaryrefslogtreecommitdiffstats
path: root/generic/tclInt.h
diff options
context:
space:
mode:
authorapnadkarni <apnmbx-wits@yahoo.com>2023-05-05 09:17:17 (GMT)
committerapnadkarni <apnmbx-wits@yahoo.com>2023-05-05 09:17:17 (GMT)
commit5940356ced08a62f3dedc17888f34345dd09af61 (patch)
tree57b6c65d8be2c9b2b531b348b66e93c5a933f7e1 /generic/tclInt.h
parent92dd14e77c81c060ff6ede641885b928afdb9ec3 (diff)
downloadtcl-5940356ced08a62f3dedc17888f34345dd09af61.zip
tcl-5940356ced08a62f3dedc17888f34345dd09af61.tar.gz
tcl-5940356ced08a62f3dedc17888f34345dd09af61.tar.bz2
Change reallocation growth to 1.5.
Diffstat (limited to 'generic/tclInt.h')
-rw-r--r--generic/tclInt.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/generic/tclInt.h b/generic/tclInt.h
index 4d2f85d..660c19f 100644
--- a/generic/tclInt.h
+++ b/generic/tclInt.h
@@ -2898,9 +2898,10 @@ TclUpsizeAlloc(TCL_UNUSED(Tcl_Size) /*oldSize*/,
Tcl_Size limit)
{
/* assert (oldCapacity < needed <= limit) */
- if (needed < (limit - needed)) {
- return 2 * needed;
- } else {
+ if (needed < (limit - needed/2)) {
+ return needed + needed / 2;
+ }
+ else {
return limit;
}
}