Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2002-05-25
02:32 • Add attachment gmttz.patch to ticket [559376ffff] artifact: 9d49f2a973 user: hobbs
02:32 • Closed ticket [559376ffff]: Clock format w/ -gmt 1 leaks memory plus 8 other... artifact: bd4d34b546 user: hobbs
2002-05-23
16:20 • Ticket [559376ffff]: 2 changes artifact: 73238cae36 user: dkf
2002-05-22
21:48 • New ticket [559376ffff]. artifact: da47b274c8 user: nobody

Clock format w/ -gmt 1 leaks memory

Closed / Fixed559376ffffffffffffffffffffffffffffffffffCreated 25 years agoUpdated 25 years ago
Descriptionplain2002-05-22 21:48:21
We have discovered the following :
    clock format 0 -gmt 1

Actually it does not matter what the value to clock 
format is as long as you set -gmt 1.

Here is a script that will leak::
    while 1 {clock format 0 -gmt 1}

It also appears that -gmt 1 takes 18 times longer to 
execute than -gmt 0
dkf Ticket [559376ffff]: 2 changes [History diff]2002-05-23 16:20:20
hobbsplain2002-05-25 02:32:56
File Added - 23694: gmttz.patch

Logged In: YES 
user_id=72656

Attached is a patch for 8.3 (also will apply to 8.4) that fixes 
this problem, as well as making it faster to boot.  This passes 
the useGMT to TclpStrftime so that we avoid needing the env
(TZ) setting trick, which is where the mem leak occured (due 
to a Windows msvcrt bug).

In addition, this also makes the %c %x and %X locale-
specific time/date formats work correctly on Windows, as 
well as correcting the behavior of %s with -gmt 1.
Log in (anonymous is fine) to add a comment.

Attachments: