A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2002-October/029398.html below:

[Python-Dev] tests failing in 2.2.2

[Python-Dev] tests failing in 2.2.2Neal Norwitz neal@metaslash.com
Tue, 8 Oct 2002 17:06:39 -0400
On Tue, Oct 08, 2002 at 04:25:06PM -0400, Guido van Rossum wrote:
> [Tim]
> > > with a four-byte pointer, you attempt to allocate 0x20000000L items (due
> > > to roundupsize), which is small enough to try a realloc. In turn, it
> > > tries to allocate 0x80000000L bytes, i.e. 2GB. On a 32-bit machine, it
> > > is possible to allocate that much memory.
> > 
> > Depending on platform, of course.  Under MSVC6, it does call the platform
> > realloc(), and it's the latter that returns a NULL pointer (the max you can
> > alloc under Win32 is 0x7ffdefff).
> > 
> > If we changed the test to use maxint // 2 instead, it would (just barely)
> > trigger the
> > 
> >     _new_size <= ((~(size_t)0) / sizeof(type))
> > 
> > test in NRESIZE instead, and keep the platform realloc() out of it.
> > 
> > Good enough?
> 
> [Guido] I'd say so, except I fear that it might cause different
> problems (not that I know of any).  I tried it on Linux and on Win98
> and it works fine.  I presume you've tested it on Win2K.
> 
> But wasn't it specifically designed to catch a condition that was only
> true when the size was (approximately) maxint/4?

The original problem was actually 1e9.  The test is somewhat dubious,
so anything to reduce the problems would be good.  Perhaps the test
should just be removed?

Neal



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4