[Python-Dev] Memory size overflows (original) (raw)
Tim Peters tim.one@comcast.net
Sat, 19 Oct 2002 23:39:08 -0400
- Previous message: [Python-Dev] Memory size overflows
- Next message: [Python-Dev] Memory size overflows
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
[Tim\
If you've actually got the energy to time these things , how about adapting the int-mul overflow checking code in Python's intobject.c's intmul() function too?
[Gerald S. Williams]
I'll take a look.
Thanks!
It could be simplified a little if it were specialized to unsigned mult.
You're simply referring to breaking down the operation into "remove sign", multiply, and "generate sign" stages, right? I'll definitely keep it in mind.
Goodness no -- that kind of cleverness is usually buggy, and usually by failing to account for that the moral equivalent of -sys.maxint-1 is a fine product, but sys.maxint+1 isn't. I was talking specifically about the based-on-doubles int_mul(). In particular, the slow-path line
const double absprod = doubleprod >= 0.0 ? doubleprod :
-doubleprod;isn't needed if we know the product is >= 0.
- Previous message: [Python-Dev] Memory size overflows
- Next message: [Python-Dev] Memory size overflows
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]