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)
commita720a9f6e21c4c9afd7a4b125478dc9800db11c2 (patch)
tree6fe041ed2c20bacf83cb1461e04f999517ed8740 /generic/tclListObj.c
parent3495bd2531b93a17421d6dc087527ef5fa111118 (diff)
downloadtcl-a720a9f6e21c4c9afd7a4b125478dc9800db11c2.zip
tcl-a720a9f6e21c4c9afd7a4b125478dc9800db11c2.tar.gz
tcl-a720a9f6e21c4c9afd7a4b125478dc9800db11c2.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);