]> granicus.if.org Git - python/commitdiff
Merged revisions 66383 via svnmerge from
authorMartin v. Löwis <martin@v.loewis.de>
Thu, 11 Sep 2008 06:55:48 +0000 (06:55 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Thu, 11 Sep 2008 06:55:48 +0000 (06:55 +0000)
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r66383 | martin.v.loewis | 2008-09-11 08:53:30 +0200 (Do, 11 Sep 2008) | 3 lines

  Issue #3642: Suppress warning in obmalloc when size_t is
  larger than uint. Reverts r65975. Reviewed by Brett Cannon.
........

Objects/obmalloc.c

index b4ad60a86565b50a2780b6063f019ba5c597f31d..fc5ccf7abee2c6b7cca91abdef498613f1a2c600 100644 (file)
@@ -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)