[Vm-dev] instantiateClass:indexableSize: upper limit?
bert at freudenbergs.de
Fri Jun 23 12:04:22 UTC 2017
On Fri, Jun 23, 2017 at 10:35 AM, Tom Beckmann <tomjonabc at gmail.com> wrote:
> Dear VM devs,
> I'm trying to allocate a Bitmap of around 16MB size in a plugin via
> `interpreterProxy instantiateClass: interpreterProxy classBitmap
> indexableSize: size`.
> However, I always get NULL back. I already tried wrapping the primitive
> call in `retryWithGC:until:`, with the same effect. Running a normal
> `Bitmap new: 16000000` from a workspace works flawlessly.
> I'm on a Ubuntu 16.04 64bit, running a squeak 32bit built from trunk.
> Is there anything to watch out for?
Yes. Object allocation is better handled in the image, because you don't
want to deal with garbage collection strategies in a primitive. The typical
way is to pass a pre-allocated array into the primitive which fills it.
- Bert -
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Vm-dev