Skip to content
Tcl Source Code Artifact [224fbdfaef]
Login

Artifact [224fbdfaef]

Artifact 224fbdfaef31c226f65e481581b9a6bbeee31472edf5ed47bc8f362712010b7d:

Wiki page [(Initi/Fin)alize] by aku on 2018-11-14 17:21:34.
D 2018-11-14T17:21:34.713
L (Initi/Fin)alize
P 08910dcb6736ee9a1d7edd8ab87b17b5381b5b86
U aku
W 1648
<h1>Source Files</h1>
  *  portions of [/finfo?name=generic/tclEvent.c|tclEvent.c]

<h1>Public Interface</h1>
  *  Tcl_CreateExitHandler
  *  Tcl_DeleteExitHandler
  *  Tcl_CreateThreadExitHandler
  *  Tcl_DeleteThreadExitHandler
  *  Tcl_SetExitProc
  *  Tcl_Exit
  *  Tcl_Finalize
  *  Tcl_FinalizeThread

<h1>Private Interface</h1>
  *  TclCreateLateExitHandler
  *  TclDeleteLateExitHandler
  *  TclInitSubsystems
  *  TclInExit
  *  TclInThreadExit

<h1>Configuration Defines</h1>
  *  <code>TCL_FINALIZE_ON_EXIT</code> - When defined, free all memory on exit, despite the OS cleaning up after anyway. This reduces reports of false resource leaks for both dynamic and static memory trackers (valgrind, coverity).

<h1>Directly Depends On Public Interface</h1>
  *  <i>just about everything</i>

<h1>Directly Depends On Private Interface of</h1>
  *  <i>just about everything</i>

<h1>Discussion</h1>

This module is devoted to control over the initialization
and finalization of the subsystems of Tcl, and extensions to it by way of
exit handlers and thread exit handlers.  This is the part that could use a
good audit and reform, particularly in examining  multi-threaded
finalization.

The routine <b>TclInitSubsystems</b> needs to become
public, so that Tcl using apps can bring up and tear down the Tcl library
via an approved set of routines.

It may be that the <b>TclIn(Thread)Exit</b>
routines are needed by extensions as well.  Or as an alternative,
it would be nice if Tcl finalization were well-behaved enough
that nothing else had to care whether or not they were
running "in exit".


Z 7e9e10733f3bb6bd2a7bda32dc43d17c