<br><br><div class="gmail_quote">On Wed, Feb 18, 2009 at 5:09 AM, Igor Stasenko <span dir="ltr"><<a href="mailto:siguctua@gmail.com">siguctua@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
A headerTypeBytes ivar used in Interpreter, but initialized only once<br>
during its lifetime - in readImageFromFile: f HeapSize:<br>
desiredHeapSize StartingAt: imageOffset),<br>
and with same constants:<br>
<br>
headerTypeBytes at: 0 put: BytesPerWord * 2. "3-word header (type 0)"<br>
headerTypeBytes at: 1 put: BytesPerWord. "2-word header (type 1)"<br>
headerTypeBytes at: 2 put: 0. "free chunk (type 2)"<br>
headerTypeBytes at: 3 put: 0. "1-word header (type 3)"<br>
<br>
I think this initialization could be put into static var declaration,<br>
in #declareCVarsIn:<br>
aCCodeGenerator<br>
var: #headerTypeBytes<br>
declareC: 'static sqInt headerTypeBytes[4] = { blablabla}'.</blockquote><div><br></div><div>Make this declareC: 'static const sqInt headerTypeBytes[4] = { blablabla}'</div><div> ^^^^^</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br>
<br>
then we don't have to pollute already complex #readImageFromFile:...<br>
method with odd stuff like this.<br>
<br>
It maybe not worth much attention for Squeak VM, but for Hydra, i<br>
found that this ivar placed into Interpreter struct (which means that<br>
each instance of interpreter will having separate headerTypeBytes).<br>
There are tons of ivars in ObjectMemory and Interpreter and its hard<br>
to track all, which worth keeping on a per-interpreter basis :)<br>
<font color="#888888"><br>
--<br>
Best regards,<br>
Igor Stasenko AKA sig.<br>
</font></blockquote></div><br>