<div dir="ltr">Hi Bert,<div><br></div><div>    it was a regression in argument validation for become introduced in fixing argument validation for the one-way copy hash case.  The code was erroneously checking that it had space to create copies of the input arguments, even though it was a one-way become.  It&#39;s a copyHash become and that confused it.  It&#39;s now fixed.  I&#39;ll generate sources and push and new builds should appear shortly ;-)</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 16, 2016 at 5:11 AM, Bert Freudenberg <span dir="ltr">&lt;<a href="mailto:bert@freudenbergs.de" target="_blank">bert@freudenbergs.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <br><div dir="ltr">I&#39;m reading a 20MB text file. At some point it tries to convert the 20 MB ByteString into an 80 MB WideString using forward become. This fails resulting in an endless loop. The primitive failure code for elementsForwardIdentityTo: (primitive 72) is  #&#39;insufficient object memory&#39; and it tries again after growing:<div><span style="white-space:pre-wrap"><br></span></div><div><span style="white-space:pre-wrap">        </span>ec == #&#39;insufficient object memory&#39; ifTrue:<br></div><div><div><div><span style="white-space:pre-wrap">                </span>[Smalltalk garbageCollect &lt; 1048576 ifTrue:</div><div><span style="white-space:pre-wrap">                        </span>[Smalltalk growMemoryByAtLeast: 1048576].</div><div><span style="white-space:pre-wrap">                </span> ^self elementsForwardIdentityTo: otherArray].</div></div><div><br></div><div>but the growMemoryByAtLeast: does not actually grow the memory:</div><div><br></div><div><div><span style="white-space:pre-wrap">        </span>{Smalltalk garbageCollect.</div><div><span style="white-space:pre-wrap">        </span>Smalltalk growMemoryByAtLeast: 1048576.</div><div><span style="white-space:pre-wrap">        </span>Smalltalk garbageCollect.}</div></div><div><br></div><div>==&gt;  #(58576608 16777216 58576608)</div><div><br></div><div>58 MB are not enough, but it doesn&#39;t grow any further.</div><div><br></div><div>The question is, why does it try to allocate a new object at all? The WideString exists already. I thought Spur would simply install a forwarder?</div><div><br></div><div>To reproduce, execute </div><div><br></div><div><span style="white-space:pre-wrap">        </span>(ByteString new: 20000000) writeStream nextPut: (Character value: 128169)<br></div><div><br></div><div>You probably want to follow that with a user interrupt (Cmd-period).</div><div><br></div><div>This happens using the latest Spur VM from github (r201606160944)</div></div><div><br></div><div>- Bert -</div></div>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div>
</div>