diff options
author | ashok <ashok> | 2014-09-03 15:48:56 (GMT) |
---|---|---|
committer | ashok <ashok> | 2014-09-03 15:48:56 (GMT) |
commit | 497aa76e901586dee5b41e797c50da9fb9d8f569 (patch) | |
tree | 79a8f2f3ac349fc474e49236ca12c7f111f74e32 | |
parent | a4a3d764f5bc4047858e2a14a54d26c55b1cf0c0 (diff) | |
download | tcl-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.
-rw-r--r-- | generic/tclThreadAlloc.c | 3 |
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; |