diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2018-01-18 10:15:25 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-18 10:15:25 (GMT) |
commit | 05d68a8bd84cb141be9f9335f5b3540f15a989c4 (patch) | |
tree | a4e48a3b3c5b46422f83ffb9b4314eb8ea344325 /Modules/gcmodule.c | |
parent | ab74504346a6e2569b3255b7b621c589716888c4 (diff) | |
download | cpython-05d68a8bd84cb141be9f9335f5b3540f15a989c4.zip cpython-05d68a8bd84cb141be9f9335f5b3540f15a989c4.tar.gz cpython-05d68a8bd84cb141be9f9335f5b3540f15a989c4.tar.bz2 |
bpo-9566: Fix size_t=>int downcast warnings (#5230)
* Use wider types (int => Py_ssize_t) to avoid integer overflows.
* Fix gc.get_freeze_count(): use Py_ssize_t type rather than int, since gc_list_size() returns a Py_ssize_t.
Diffstat (limited to 'Modules/gcmodule.c')
-rw-r--r-- | Modules/gcmodule.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c index 121eb46..ea3c294 100644 --- a/Modules/gcmodule.c +++ b/Modules/gcmodule.c @@ -1449,14 +1449,14 @@ gc_unfreeze_impl(PyObject *module) } /*[clinic input] -gc.get_freeze_count -> int +gc.get_freeze_count -> Py_ssize_t Return the number of objects in the permanent generation. [clinic start generated code]*/ -static int +static Py_ssize_t gc_get_freeze_count_impl(PyObject *module) -/*[clinic end generated code: output=e4e2ebcc77e5cbf3 input=4b759db880a3c6e4]*/ +/*[clinic end generated code: output=61cbd9f43aa032e1 input=45ffbc65cfe2a6ed]*/ { return gc_list_size(&_PyRuntime.gc.permanent_generation.head); } |