[Vm-dev] Array new: SmallInteger maxVal

David T. Lewis lewis at mail.msen.com
Thu Oct 8 12:25:15 UTC 2009

On Thu, Oct 08, 2009 at 09:43:34AM +0100, Douglas Brebner wrote:
> John M McIntosh wrote:
> >
> > It's a issue of what is insane, plus adding boundary checks everywhere
> > that is rarely needed.
> >
> > The correct response for the issue is to throw a out of memory
> > exception when the VM figures out it
> > can't allocate the 4GB of memory here.
> >
> Isn't that possible on a 64bit vm/image?

Well, there are definitely bugs in the VM right now and these need to be
fixed. But as a practical matter I find that the following takes several
minutes to complete on my computer:

	Array new: 16r001FFFFFF

This is well within the addressing range for both 32-bit images and
32-bit VMs, so as a practical matter 64-bit addressing does not matter

So in summary:

- The VM needs to be fixed to behave properly even if the amount of
memory requested is unreasonable.

- It might be useful to have the image guard against requests that
are unreasonable (e.g. raise an error instead of calling a primitive
that is going to take several minutes to complete).

The first point is indisputable, the second could probably be debated
for a long time ;)


More information about the Vm-dev mailing list