Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
2a94475c
Commit
2a94475c
authored
Mar 28, 2006
by
Tim Peters
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
In format strings slinging Py_ssize_t, unconditionally
interpolate PY_FORMAT_SIZE_T instead of #if'ing on MS_WIN64.
parent
89b9ce45
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
31 deletions
+15
-31
Modules/gcmodule.c
Modules/gcmodule.c
+9
-22
Python/pythonrun.c
Python/pythonrun.c
+6
-9
No files found.
Modules/gcmodule.c
View file @
2a94475c
...
...
@@ -413,7 +413,7 @@ has_finalizer(PyObject *op)
assert
(
delstr
!=
NULL
);
return
_PyInstance_Lookup
(
op
,
delstr
)
!=
NULL
;
}
else
else
return
op
->
ob_type
->
tp_del
!=
NULL
;
}
...
...
@@ -741,15 +741,9 @@ collect(int generation)
PySys_WriteStderr
(
"gc: collecting generation %d...
\n
"
,
generation
);
PySys_WriteStderr
(
"gc: objects in each generation:"
);
for
(
i
=
0
;
i
<
NUM_GENERATIONS
;
i
++
)
{
#ifdef MS_WIN64
PySys_WriteStderr
(
" %Id"
,
gc_list_size
(
GEN_HEAD
(
i
)));
#else
PySys_WriteStderr
(
" %ld"
,
Py_SAFE_DOWNCAST
(
gc_list_size
(
GEN_HEAD
(
i
)),
Py_ssize_t
,
long
));
#endif
}
for
(
i
=
0
;
i
<
NUM_GENERATIONS
;
i
++
)
PySys_WriteStderr
(
" %"
PY_FORMAT_SIZE_T
"d"
,
gc_list_size
(
GEN_HEAD
(
i
)));
PySys_WriteStderr
(
"
\n
"
);
}
...
...
@@ -837,21 +831,14 @@ collect(int generation)
debug_cycle
(
"uncollectable"
,
FROM_GC
(
gc
));
}
if
(
debug
&
DEBUG_STATS
)
{
if
(
m
==
0
&&
n
==
0
)
{
if
(
m
==
0
&&
n
==
0
)
PySys_WriteStderr
(
"gc: done.
\n
"
);
}
else
{
#ifdef MS_WIN64
else
PySys_WriteStderr
(
"gc: done, %Id unreachable, %Id uncollectable.
\n
"
,
"gc: done, "
"%"
PY_FORMAT_SIZE_T
"d unreachable, "
"%"
PY_FORMAT_SIZE_T
"d uncollectable.
\n
"
,
n
+
m
,
n
);
#else
PySys_WriteStderr
(
"gc: done, %ld unreachable, %ld uncollectable.
\n
"
,
Py_SAFE_DOWNCAST
(
n
+
m
,
Py_ssize_t
,
long
),
Py_SAFE_DOWNCAST
(
n
,
Py_ssize_t
,
long
));
#endif
}
}
/* Append instances in the uncollectable set to a Python
...
...
Python/pythonrun.c
View file @
2a94475c
...
...
@@ -30,14 +30,11 @@
#endif
#ifndef Py_REF_DEBUG
#
define PRINT_TOTAL_REFS()
#define PRINT_TOTAL_REFS()
#else
/* Py_REF_DEBUG */
# if defined(MS_WIN64)
# define PRINT_TOTAL_REFS() fprintf(stderr, "[%Id refs]\n", _Py_RefTotal);
# else
/* ! MS_WIN64 */
# define PRINT_TOTAL_REFS() fprintf(stderr, "[%ld refs]\n", \
Py_SAFE_DOWNCAST(_Py_RefTotal, Py_ssize_t, long));
# endif
/* MS_WIN64 */
#define PRINT_TOTAL_REFS() fprintf(stderr, \
"[%" PY_FORMAT_SIZE_T "d refs]\n", \
_Py_RefTotal)
#endif
extern
char
*
Py_GetPath
(
void
);
...
...
@@ -393,7 +390,7 @@ Py_Finalize(void)
dump_counts
();
#endif
PRINT_TOTAL_REFS
()
PRINT_TOTAL_REFS
()
;
#ifdef Py_TRACE_REFS
/* Display all objects still alive -- this can invoke arbitrary
...
...
@@ -683,7 +680,7 @@ PyRun_InteractiveLoopFlags(FILE *fp, const char *filename, PyCompilerFlags *flag
}
for
(;;)
{
ret
=
PyRun_InteractiveOneFlags
(
fp
,
filename
,
flags
);
PRINT_TOTAL_REFS
()
PRINT_TOTAL_REFS
()
;
if
(
ret
==
E_EOF
)
return
0
;
/*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment