From 18d6765361d9e2703b6f02c23d4edb0c79dffbf6 Mon Sep 17 00:00:00 2001 From: dkf Date: Tue, 20 Dec 2005 22:16:48 +0000 Subject: Use %ld instead of %d in Tcl_GetMemoryInfo --- ChangeLog | 7 ++++++- generic/tclThreadAlloc.c | 18 +++++++++--------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index c1027a5..8b66c5d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,10 +1,15 @@ +2005-12-20 Donal K. Fellows + + * generic/tclThreadAlloc.c (Tcl_GetMemoryInfo): Format values as longs + and not ints, so they are less likely to wrap on 64-bit machines. + 2005-12-19 Don Porter * generic/tclCmdMZ.c: Modified [string is double] to use * tests/string.test: TclParseNumber() to parse trailing whitespace. Ensures consistency, and makes it easier to cleanup after invalid internal reps left behind by parsing [Bugs 1360432 1382287]. - + * generic/tclParseExpr.c: Added TCL_PARSE_NO_WHITESPACE to * generic/tclScan.c: TclParseNumber() calls since [scan] and * tests/scan.test: [expr] parsing don't want spaces in parsed diff --git a/generic/tclThreadAlloc.c b/generic/tclThreadAlloc.c index 392d1d8..9c77910 100755 --- a/generic/tclThreadAlloc.c +++ b/generic/tclThreadAlloc.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclThreadAlloc.c,v 1.19 2005/11/27 02:33:49 das Exp $ + * RCS: @(#) $Id: tclThreadAlloc.c,v 1.20 2005/12/20 22:16:48 dkf Exp $ */ #include "tclInt.h" @@ -79,15 +79,15 @@ typedef struct Block { typedef struct Bucket { Block *firstPtr; /* First block available */ - int numFree; /* Number of blocks available */ + long numFree; /* Number of blocks available */ /* All fields below for accounting only */ - int numRemoves; /* Number of removes from bucket */ - int numInserts; /* Number of inserts into bucket */ - int numWaits; /* Number of waits to acquire a lock */ - int numLocks; /* Number of locks acquired */ - int totalAssigned; /* Total space assigned to bucket */ + long numRemoves; /* Number of removes from bucket */ + long numInserts; /* Number of inserts into bucket */ + long numWaits; /* Number of waits to acquire a lock */ + long numLocks; /* Number of locks acquired */ + long totalAssigned; /* Total space assigned to bucket */ } Bucket; /* @@ -630,8 +630,8 @@ Tcl_GetMemoryInfo( Tcl_DStringAppendElement(dsPtr, buf); } for (n = 0; n < NBUCKETS; ++n) { - sprintf(buf, "%d %d %d %d %d %d %d", - (int) bucketInfo[n].blockSize, + sprintf(buf, "%lu %ld %ld %ld %ld %ld %ld", + (unsigned long) bucketInfo[n].blockSize, cachePtr->buckets[n].numFree, cachePtr->buckets[n].numRemoves, cachePtr->buckets[n].numInserts, -- cgit v0.12