]> granicus.if.org Git - python/commitdiff
Issue #18942: sys._debugmallocstats() output was damaged on Windows.
authorTim Peters <tim@python.org>
Fri, 6 Sep 2013 03:57:04 +0000 (22:57 -0500)
committerTim Peters <tim@python.org>
Fri, 6 Sep 2013 03:57:04 +0000 (22:57 -0500)
_PyDebugAllocatorStats() called PyOS_snprintf() with a %zd format
code, but MS doesn't support that code.  Interpolated
PY_FORMAT_SIZE_T in place of the "z".

Misc/NEWS
Objects/obmalloc.c

index 5439b74b0935ed1bfd5c6ed9fc5114938a6337fb..8052c6b6b72e609e23b4d07e0a834cbd5ee55d94 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -12,6 +12,8 @@ What's New in Python 3.3.3 release candidate 1?
 Core and Builtins
 -----------------
 
+- Issue #18942: sys._debugmallocstats() output was damaged on Windows.
+
 - Issue #18667: Add missing "HAVE_FCHOWNAT" symbol to posix._have_functions.
 
 - Issue #18368: PyOS_StdioReadline() no longer leaks memory when realloc()
index 50fc7c155d4636bbed583f4a751269c48cf860bf..c261b689beb6d4383770294cc45bb770e3726fda 100644 (file)
@@ -1761,7 +1761,7 @@ _PyDebugAllocatorStats(FILE *out,
     char buf1[128];
     char buf2[128];
     PyOS_snprintf(buf1, sizeof(buf1),
-                  "%d %ss * %zd bytes each",
+                  "%d %ss * %" PY_FORMAT_SIZE_T "d bytes each",
                   num_blocks, block_name, sizeof_block);
     PyOS_snprintf(buf2, sizeof(buf2),
                   "%48s ", buf1);