[PD] Array Size limits

Mathieu Bouchard matju at artengine.ca
Mon Oct 24 19:13:56 CEST 2011

Le 2011-10-24 à 17:58:00, IOhannes m zmoelnig a écrit :
> On 2011-10-24 16:24, Mathieu Bouchard wrote:
>> -maxsize between 4GB and 6GB will pretend that the size is 4GB less than
>> what you specified.
> [...]
>> -maxsize between 4GB and 6GB will pretend that the size is 8GB less than
>> what you specified.
> hein?

A big sorry... although I got the overall point right, I made FOUR 
mistakes in the mail :

1. First, the obvious typo. I wanted to write « between 8GB and 10GB » in 
the latter part. Basically, I just meant wrapping around at 2GB, and 
crossing zero at 4GB... a signed modulo pow(2,32).

2. In 64-bit mode, the long type is 64-bit, which I also already knew ; so 
in that case, there is no problem with crossing the 2GB limit.

3. I didn't actually try it with a C compiler. When I did, I saw that it's 
not at all the same as when casting from a big int type to a smaller int 
type. When I cast from float to a 32-bit int, any overflow gives 
-2147483648 instead of wrapping around.

4. Pd's check for negative numbers does not replace them by 0, it posts 
the «usage» message and refuses to do work. I had already verified this a 
few days ago and forgot it.

In any case, there is still the problem that if the user does -maxsize 
1e+10 on a 32-bit platform, there's nothing that tells him what's wrong. 
The user just gets an uninformative error message that implies (without 
actually stating) that something in the syntax is wrong.

| Mathieu BOUCHARD ----- téléphone : +1.514.383.3801 ----- Montréal, QC

More information about the Pd-list mailing list