[OpenSmalltalk/opensmalltalk-vm] 11a812: Hotfix for Squeak3D on 64bits VM

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[OpenSmalltalk/opensmalltalk-vm] 11a812: Hotfix for Squeak3D on 64bits VM

Eliot Miranda-3
 
  Branch: refs/heads/Cog
  Home:   https://github.com/OpenSmalltalk/opensmalltalk-vm
  Commit: 11a812894dd9c9cbb774c8d3d4cf4713936c5640
      https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/11a812894dd9c9cbb774c8d3d4cf4713936c5640
  Author: Nicolas Cellier <[hidden email]>
  Date:   2020-02-27 (Thu, 27 Feb 2020)

  Changed paths:
    M src/plugins/Squeak3D/Squeak3D.c

  Log Message:
  -----------
  Hotfix for Squeak3D on 64bits VM

The B3DRasterizer state.objects store pointers to B3D objects into a 4-bytes Smalltalk WordArray.
This means that appropriate arithmetic has to take place in order to compute the number of objects stored in that WordArray
Indeed, on 64bits VM, each object pointer is going to consume 8-bytes (2 words).

That also means that proper allocation of Smalltalk WordArray has to take place at image side.
A fix to `B3DPrimitiveRasterizerState>>initObjects:` is thus also required

    objects := B3DPrimitiveRasterizerData new: nObjects * (Smalltalk wordSize / 4)

The slang and image Smalltalk code have not been published yet.
They are waiting for approval of my Developer status on http://www.squeaksource.com/Balloon3D.html