summaryrefslogtreecommitdiffstats
path: root/generic/tclThreadAlloc.c
diff options
context:
space:
mode:
authorashok <ashok>2014-09-03 15:48:56 (GMT)
committerashok <ashok>2014-09-03 15:48:56 (GMT)
commit497aa76e901586dee5b41e797c50da9fb9d8f569 (patch)
tree79a8f2f3ac349fc474e49236ca12c7f111f74e32 /generic/tclThreadAlloc.c
parenta4a3d764f5bc4047858e2a14a54d26c55b1cf0c0 (diff)
downloadtcl-497aa76e901586dee5b41e797c50da9fb9d8f569.zip
tcl-497aa76e901586dee5b41e797c50da9fb9d8f569.tar.gz
tcl-497aa76e901586dee5b41e797c50da9fb9d8f569.tar.bz2
[132fad6fde]. Fixed GetCache to use TclpSysAlloc+memset instead
of calloc. Now consistent with tclWinThrd.c which no longer uses malloc in its TclpSysAlloc implementation.
Diffstat (limited to 'generic/tclThreadAlloc.c')
-rw-r--r--generic/tclThreadAlloc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/generic/tclThreadAlloc.c b/generic/tclThreadAlloc.c
index 5cb8027..560556d 100644
--- a/generic/tclThreadAlloc.c
+++ b/generic/tclThreadAlloc.c
@@ -217,10 +217,11 @@ GetCache(void)
cachePtr = TclpGetAllocCache();
if (cachePtr == NULL) {
- cachePtr = calloc(1, sizeof(Cache));
+ cachePtr = TclpSysAlloc(sizeof(Cache), 0);
if (cachePtr == NULL) {
Tcl_Panic("alloc: could not allocate new cache");
}
+ memset(cachePtr, 0, sizeof(Cache));
Tcl_MutexLock(listLockPtr);
cachePtr->nextPtr = firstCachePtr;
firstCachePtr = cachePtr;