Tcl Source Code

Check-in [9fb15282b0]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment: * win/tclWinThrd.c (TclpFinalizeThreadData, TclWinFreeAllocCache): Applied patch for bug #599428, provided by Miguel Sofer <[email protected]>.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | macosx-8-4-premerge-2002-08-31-trunk | macosx-8-4-merge-2002-08-30-trunk
Files: files | file ages | folders
SHA1: 9fb15282b0091e3c0f329bdf02b74e9aeeafaf90
User & Date: andreas_kupries 2002-08-29 19:02:19
Context
2002-08-31
06:09
*** macosx-8-4-branch merged into the mainline [tcl patch #602770] ***
* generic/tcl.decls: added...
check-in: ac07f034c7 user: das tags: trunk, macosx-8-4-merge-2002-08-31-trunk
2002-08-29
19:02
* win/tclWinThrd.c (TclpFinalizeThreadData, TclWinFreeAllocCache): Applied patch for bug #59942... check-in: 9fb15282b0 user: andreas_kupries tags: trunk, macosx-8-4-premerge-2002-08-31-trunk, macosx-8-4-merge-2002-08-30-trunk
2002-08-28
22:49
no message check-in: ed24b018a2 user: davygrvy tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ChangeLog.







1
2
3
4
5
6
7





2002-08-28  David Gravereaux <[email protected]>

	* generic/tclEnv.c:
	* unix/configure.in:
	* win/tclWinPort.h:  putenv() on some systems copies the buffer
	rather than taking reference to it.  This causes memory leaks
	and is know to effect mswindows (msvcrt) and NetBSD 1.5.2 .  This
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
2002-08-29  Andreas Kupries  <[email protected]>

	* win/tclWinThrd.c (TclpFinalizeThreadData, TclWinFreeAllocCache):
	  Applied patch for bug #599428, provided by Miguel Sofer
	  <[email protected]>.

2002-08-28  David Gravereaux <[email protected]>

	* generic/tclEnv.c:
	* unix/configure.in:
	* win/tclWinPort.h:  putenv() on some systems copies the buffer
	rather than taking reference to it.  This causes memory leaks
	and is know to effect mswindows (msvcrt) and NetBSD 1.5.2 .  This

Changes to win/tclWinThrd.c.

5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
...
629
630
631
632
633
634
635
636
637
638
639
640

641
642
643
644
645
646
647
648
649
650
651
....
1035
1036
1037
1038
1039
1040
1041

1042
1043

1044
1045
1046
1047
 *
 * Copyright (c) 1998 by Sun Microsystems, Inc.
 * Copyright (c) 1999 by Scriptics Corporation
 *
 * See the file "license.terms" for information on usage and redistribution
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tclWinThrd.c,v 1.19 2002/04/23 17:03:35 hobbs Exp $
 */

#include "tclWinInt.h"

#include <fcntl.h>
#include <io.h>
#include <sys/stat.h>
................................................................................

void
TclpFinalizeThreadData(keyPtr)
    Tcl_ThreadDataKey *keyPtr;
{
    VOID *result;
    DWORD *indexPtr;
#ifdef USE_THREAD_ALLOC
    static int once = 0;

    if (!once) {
	once = 1;

	TclWinFreeAllocCache();
    }
#endif

    if (*keyPtr != NULL) {
	indexPtr = *(DWORD **)keyPtr;
	result = (VOID *)TlsGetValue(*indexPtr);
	if (result != NULL) {
	    ckfree((char *)result);
	    TlsSetValue(*indexPtr, (void *)NULL);
	}
................................................................................

void
TclWinFreeAllocCache(void)
{
    void *ptr;

    ptr = TlsGetValue(key);

    TlsSetValue(key, NULL);
    TclFreeAllocCache(ptr);

}

#endif /* USE_THREAD_ALLOC */
#endif /* TCL_THREADS */






|







 







<
<

<
<
>
|
<

<







 







>
|
|
>




5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
...
629
630
631
632
633
634
635


636


637
638

639

640
641
642
643
644
645
646
....
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
 *
 * Copyright (c) 1998 by Sun Microsystems, Inc.
 * Copyright (c) 1999 by Scriptics Corporation
 *
 * See the file "license.terms" for information on usage and redistribution
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tclWinThrd.c,v 1.20 2002/08/29 19:02:19 andreas_kupries Exp $
 */

#include "tclWinInt.h"

#include <fcntl.h>
#include <io.h>
#include <sys/stat.h>
................................................................................

void
TclpFinalizeThreadData(keyPtr)
    Tcl_ThreadDataKey *keyPtr;
{
    VOID *result;
    DWORD *indexPtr;





#ifdef USE_THREAD_ALLOC
    TclWinFreeAllocCache();

#endif

    if (*keyPtr != NULL) {
	indexPtr = *(DWORD **)keyPtr;
	result = (VOID *)TlsGetValue(*indexPtr);
	if (result != NULL) {
	    ckfree((char *)result);
	    TlsSetValue(*indexPtr, (void *)NULL);
	}
................................................................................

void
TclWinFreeAllocCache(void)
{
    void *ptr;

    ptr = TlsGetValue(key);
    if (ptr != NULL) {
	TlsSetValue(key, NULL);
	TclFreeAllocCache(ptr);
    }
}

#endif /* USE_THREAD_ALLOC */
#endif /* TCL_THREADS */