BTW, there&#39;s clearly an exception for format = 7 which is supposed to be 64-bit longs.  So lengthOf:baseheader:format: looks wrong for 64-bit images.  It needs to say something like<div><br></div><div><div><span class="Apple-tab-span" style="white-space:pre">        </span>fmt &lt;= 4</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>ifTrue: [ ^ (sz - BaseHeaderSize) &gt;&gt; ShiftForWord &quot;words&quot;].</div><div><div><span class="Apple-tab-span" style="white-space: pre; ">        </span>fmt = 7</div>
<div><span class="Apple-tab-span" style="white-space: pre; ">                </span>ifTrue: [ ^ (sz - BaseHeaderSize) &gt;&gt; 3 &quot;64-bit longs&quot;].</div></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>fmt &lt; 8</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>ifTrue: [ ^ (sz - BaseHeaderSize) &gt;&gt; 2 &quot;32-bit longs&quot;]</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>ifFalse: [ ^ (sz - BaseHeaderSize) - (fmt bitAnd: 3) &quot;bytes&quot;]</div>
<div><br></div><div>or format = 7 needs to be documented as being unused.</div><br><div class="gmail_quote">On Wed, Jan 13, 2010 at 10:16 AM, Eliot Miranda <span dir="ltr">&lt;<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br><br><div class="gmail_quote"><div><div></div><div class="h5">On Wed, Jan 13, 2010 at 9:13 AM, Andreas Raab <span dir="ltr">&lt;<a href="mailto:andreas.raab@gmx.de" target="_blank">andreas.raab@gmx.de</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><br>
John M McIntosh wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
So I was trying to build a 64bit VM this evening and it would die in  loadBitBltFromWarping<br>
where it check to see if the destination bit form has a byteSizeOf() that is equal to pitch * height<br>
this causes a prim failure before any drawing can occur. <br>
In the past if the form was 1,521,520 bytes this altered call returns 3,043,040.<br>
<br>
I assume this is a bug since with the previous code I could build runnable 64bit VMs...?<br>
<br>
Or then again is the bitBitPlugin wrong in it&#39;s assumption of slot size? <br>
</blockquote>
<br></div>
Depends. In a 64bit image does a Bitmap contain 32 bit entities or 64 bit entities? If the former, then byteSizeOf is wrong for Bitmap (and possibly other 32 bit containing entities). If the latter, then the pitch computation in BitBlt is wrong.<br>

</blockquote><div><br></div></div></div><div>The former.  See lengthOf:baseHeader:format:.  There is a distinction between pointer objects (format &lt;= 4) whose slots are BytesPerWord long, 32-bit objects (fmt between: 5 and: 7) whose slots are 32-bits in size, and byte objects whose slots are 8 bits in size.  byteSizeOf: clearly discards this distinction.  Why not reimplement it as</div>

<div><br></div><div><div>byteSizeOf: oop</div><div><span style="white-space:pre">        </span>| header format size |</div><div class="im"><div><span style="white-space:pre">        </span>(self isIntegerObject: oop) ifTrue:[^0].</div>

</div><div><span style="white-space:pre">        </span>header := self baseHeader: oop.</div><div><span style="white-space:pre">        </span>format := self formatOfHeader: header.</div><div><span style="white-space:pre">        </span>(header bitAnd: TypeMask) = HeaderTypeSizeAndClass</div>

<div><span style="white-space:pre">                </span>ifTrue: [ size := (self sizeHeader: oop) bitAnd: LongSizeMask ]</div><div><span style="white-space:pre">                </span>ifFalse: [ size := (header bitAnd: SizeMask)].</div>
<div><span style="white-space:pre">        </span>size := size - (header bitAnd: Size4Bit).</div><div><span style="white-space:pre">        </span>format &lt;= 4</div><div><span style="white-space:pre">                </span>ifTrue: [ ^ size - BaseHeaderSize &quot;words&quot;].</div>

<div><span style="white-space:pre">        </span>format &lt; 8</div><div><span style="white-space:pre">                </span>ifTrue: [ ^ size - BaseHeaderSize &quot;32-bit longs&quot;]</div><div>
<span style="white-space:pre">                </span>ifFalse: [ ^ (size - BaseHeaderSize) - (format bitAnd: 3) &quot;bytes&quot;]</div><div><br></div><div>which is lengthOf:baseHeader:format: rewritten not to reduce the byte size to slot count, and is of course equal to</div>

<div><br></div><div><div>byteSizeOf: oop</div><div><span style="white-space:pre">        </span>| header format size |</div><div class="im"><div><span style="white-space:pre">        </span>(self isIntegerObject: oop) ifTrue:[^0].</div>

</div><div><span style="white-space:pre">        </span>header := self baseHeader: oop.</div><div><span style="white-space:pre">        </span>format := self formatOfHeader: header.</div><div><span style="white-space:pre">        </span>(header bitAnd: TypeMask) = HeaderTypeSizeAndClass</div>

<div><span style="white-space:pre">                </span>ifTrue: [ size := (self sizeHeader: oop) bitAnd: LongSizeMask ]</div><div><span style="white-space:pre">                </span>ifFalse: [ size := (header bitAnd: SizeMask)].</div>
<div><span style="white-space:pre">        </span>size := size - (header bitAnd: Size4Bit).</div><div><span style="white-space:pre">        </span>^format &lt; 8</div><div><span style="white-space:pre">                </span>ifTrue: [ size - BaseHeaderSize &quot;32-bit longs&quot;]</div>

<div><span style="white-space:pre">                </span>ifFalse: [ (size - BaseHeaderSize) - (format bitAnd: 3) &quot;bytes&quot;]</div></div></div><div><br></div><div> with the implementation for formatOfHeader: attached and used everywhere where ((format &gt;&gt; 8) bitAnd: 16rF) is used?</div>

<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Cheers,<br><font color="#888888">
  - Andreas<br>
</font></blockquote></div><br>
</blockquote></div><br></div>