Overview
| Artifact ID: | 4a8ae18679bc3adccc220d1daf0be0e1be771965 |
|---|---|
| Ticket: | 862924ffffffffffffffffffffffffffffffffff
Memory Leak in Time/Date-Functions |
| User & Date: | kennykb on 2004-03-05 23:30:21 |
Changes
- assignee changed to: "das"
- icomment:
Logged In: YES user_id=99768 The variable returned by 'localtime' is in fact supposed to be static, rather than dynamically allocated. If a memory management tool is reporting the 'struct tm' in these functions as being leaked, it is either the tool or the C library that is in error. Freeing the memory returned by 'localtime' would be a catastrophic bug. The code in tclUnixTime.c has been replaced with the 'ThreadSafeGMTime' and 'ThreadSafeLocalTime' functions some time ago. Those functions use gmtime_r and localtime_r if available, and protect the operation with a mutex if they are not available. The Unix code for these functions uses a thread-specific data block; these blocks are cleaned up automatically in Tcl_FinalizeThread upon exit from the thread. Since Classic Mac is not supported, and the proposal is afloat to move the mac/ directory to the Attic, I question whether it's necessary at the moment to do anything with tclMacTime.c. I'm assigning this bug over to the last known maintainer of the Mac code to see if he wants to do anything with it. In short: I see no leaks; the Classic Mac code may have issues with thread safety.
- login: "kennykb"
- mimetype: "text/plain"
- priority changed to: "1 Zero"
- username: "kennykb"