diff options
author | dkf <dkf@noemail.net> | 2009-03-15 22:34:57 (GMT) |
---|---|---|
committer | dkf <dkf@noemail.net> | 2009-03-15 22:34:57 (GMT) |
commit | 99840678eac28404a52ba51546fe17bbea33d397 (patch) | |
tree | 76539d6a771d741bdb62f666ec09b879e4467dd5 /generic/tclThread.c | |
parent | 31cfe428ec90f37459fe8a47cf138e724fe31a68 (diff) | |
download | tcl-99840678eac28404a52ba51546fe17bbea33d397.zip tcl-99840678eac28404a52ba51546fe17bbea33d397.tar.gz tcl-99840678eac28404a52ba51546fe17bbea33d397.tar.bz2 |
Fix [Bug 2687952]
FossilOrigin-Name: 520dda1d96e14fa2681760bd785db1ce1440efe7
Diffstat (limited to 'generic/tclThread.c')
-rw-r--r-- | generic/tclThread.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/generic/tclThread.c b/generic/tclThread.c index a538316..314a4fb 100644 --- a/generic/tclThread.c +++ b/generic/tclThread.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclThread.c,v 1.23 2009/02/10 23:09:06 nijtmans Exp $ + * RCS: @(#) $Id: tclThread.c,v 1.24 2009/03/15 22:34:59 dkf Exp $ */ #include "tclInt.h" @@ -88,8 +88,11 @@ Tcl_GetThreadData( result = TclThreadStorageKeyGet(keyPtr); if (result == NULL) { - result = ckalloc((size_t)size); - memset(result, 0, (size_t)size); + result = TclpSysAlloc((size_t) size, 0); + if (result == NULL) { + Tcl_Panic("unable to alloc %u bytes", (unsigned) size); + } + memset(result, 0, (size_t) size); TclThreadStorageKeySet(keyPtr, result); } #else /* TCL_THREADS */ @@ -133,7 +136,6 @@ TclThreadDataKeyGet( return *keyPtr; #endif /* TCL_THREADS */ } - /* *---------------------------------------------------------------------- |