summaryrefslogtreecommitdiffstats
path: root/generic/tclListObj.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2011-05-12 15:00:02 (GMT)
committerdgp <dgp@users.sourceforge.net>2011-05-12 15:00:02 (GMT)
commitdc4fa5fd8ac0bbbf3e3f976b8a451d028abe0830 (patch)
tree6fe041ed2c20bacf83cb1461e04f999517ed8740 /generic/tclListObj.c
parent6cb89316082741c7eb0469690fb160f21ade4c87 (diff)
downloadtcl-dc4fa5fd8ac0bbbf3e3f976b8a451d028abe0830.zip
tcl-dc4fa5fd8ac0bbbf3e3f976b8a451d028abe0830.tar.gz
tcl-dc4fa5fd8ac0bbbf3e3f976b8a451d028abe0830.tar.bz2
Set the defaults of all growth algorithm parameters based on one master value.
Diffstat (limited to 'generic/tclListObj.c')
-rw-r--r--generic/tclListObj.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/generic/tclListObj.c b/generic/tclListObj.c
index f1daf19..e1c415b 100644
--- a/generic/tclListObj.c
+++ b/generic/tclListObj.c
@@ -13,10 +13,6 @@
#include "tclInt.h"
-#ifndef TCL_GROWTH_MIN_ALLOC
-#define TCL_GROWTH_MIN_ALLOC 1024
-#endif
-
/*
* Prototypes for functions defined later in this file:
*/
@@ -49,6 +45,11 @@ const Tcl_ObjType tclListType = {
UpdateStringOfList, /* updateStringProc */
SetListFromAny /* setFromAnyProc */
};
+
+#ifndef TCL_MIN_ELEMENT_GROWTH
+#define TCL_MIN_ELEMENT_GROWTH TCL_MIN_GROWTH/sizeof(Tcl_Obj *)
+#endif
+
/*
*----------------------------------------------------------------------
@@ -909,7 +910,7 @@ Tcl_ListObjReplace(
if (listRepPtr == NULL) {
unsigned int limit = LIST_MAX - numRequired;
unsigned int extra = numRequired - numElems
- + TCL_GROWTH_MIN_ALLOC/sizeof(Tcl_Obj *);
+ + TCL_MIN_ELEMENT_GROWTH;
int growth = (int) ((extra > limit) ? limit : extra);
listRepPtr = AttemptNewList(NULL, numRequired + growth, NULL);