summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2008-09-11 06:53:30 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2008-09-11 06:53:30 (GMT)
commit9fa5a2828c8007dfb678b883d65aecac93e995e4 (patch)
treec9c1b63259484b3679959bf2fa23b17d0d9933cb /Objects
parent84076d8a1180a2e5a8d2c7eeaea3f122c8579b27 (diff)
downloadcpython-9fa5a2828c8007dfb678b883d65aecac93e995e4.zip
cpython-9fa5a2828c8007dfb678b883d65aecac93e995e4.tar.gz
cpython-9fa5a2828c8007dfb678b883d65aecac93e995e4.tar.bz2
Issue #3642: Suppress warning in obmalloc when size_t is
larger than uint. Reverts r65975. Reviewed by Brett Cannon.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/obmalloc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Objects/obmalloc.c b/Objects/obmalloc.c
index b4ad60a..fc5ccf7 100644
--- a/Objects/obmalloc.c
+++ b/Objects/obmalloc.c
@@ -517,7 +517,7 @@ new_arena(void)
#endif
if (unused_arena_objects == NULL) {
uint i;
- size_t numarenas;
+ uint numarenas;
size_t nbytes;
/* Double the number of arena objects on each allocation.
@@ -526,8 +526,10 @@ new_arena(void)
numarenas = maxarenas ? maxarenas << 1 : INITIAL_ARENA_OBJECTS;
if (numarenas <= maxarenas)
return NULL; /* overflow */
+#if SIZEOF_SIZE_T <= SIZEOF_INT
if (numarenas > PY_SIZE_MAX / sizeof(*arenas))
return NULL; /* overflow */
+#endif
nbytes = numarenas * sizeof(*arenas);
arenaobj = (struct arena_object *)realloc(arenas, nbytes);
if (arenaobj == NULL)