[BUG] large files?

Dan Ingalls Dan at SqueakLand.org
Thu Nov 8 16:57:08 UTC 2001


John M McIntosh <johnmci at smalltalkconsulting.com>  observed...
>I did notice that mostly the code seems to handle 32bit positive values ok, ie fseek grabs the position as
>
>newPosition _ interpreterProxy positive32BitValueOf: (interpreterProxy stackValue: 0).
>
>However for file read and write we grab the data with
>	count		_ interpreterProxy stackIntegerValue: 0.
>	startIndex	_ interpreterProxy stackIntegerValue: 1.
>
>which *I believe* then limits you to a start and count value of < 1GB. Yes some testing shows once startIndex exceeds SmallInteger maxVal then stackIntegerValue returns zero. Which isn't what you want, so that is broken.

You're probably right.  I made the 32-bit changes without being able to test.  I asked that someone test back then, but I don't think anyone did.

>PS and why does
>
>positive32BitIntegerFor: integerValue
>..
>	newLargeInteger _
>		self instantiateSmallClass: (self splObj: ClassLargePositiveInteger)
>			sizeInBytes: 8
>...			fill: 0.
>
>create a large positive integer of 8 bytes, versus say of 4?

It doesn't.  This service routine expects a byteCount that includes 4 bytes for the base header.

	- Dan




More information about the Squeak-dev mailing list