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)
commitcb6bb091e91bf08ac9de9c6f71c175a273a1fe7d (patch)
tree79a8f2f3ac349fc474e49236ca12c7f111f74e32 /generic/tclThreadAlloc.c
parentb5eef5811353c6b95840afa31bf070ddd7f8fc0b (diff)
downloadtcl-cb6bb091e91bf08ac9de9c6f71c175a273a1fe7d.zip
tcl-cb6bb091e91bf08ac9de9c6f71c175a273a1fe7d.tar.gz
tcl-cb6bb091e91bf08ac9de9c6f71c175a273a1fe7d.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;