<br><br><div class="gmail_quote">On Thu, Jan 13, 2011 at 11:57 AM, Tobias Pape <span dir="ltr">&lt;<a href="mailto:Das.Linux@gmx.de">Das.Linux@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;">
<br>
Am 2011-01-13 um 19:46 schrieb David T. Lewis:<br>
<div class="im">&gt;<br>
&gt; On Thu, Jan 13, 2011 at 06:20:28PM +0100, Tobias Pape wrote:<br>
&gt;&gt;<br>
&gt;&gt; Am 2011-01-13 um 17:52 schrieb David T. Lewis:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; On Thu, Jan 13, 2011 at 05:26:34PM +0100, Tobias Pape wrote:<br>
&gt;&gt;&gt;&gt; [?]<br>
&gt;&gt;&gt;&gt; In a previous discussion, the method<br>
&gt;&gt;&gt;&gt; Interpreter&gt;&gt;readImageFromFile: f HeapSize: desiredHeapSize StartingAt: imageOffset<br>
&gt;&gt;&gt;&gt; was mentioned that can read the image format using the given offset.<br>
&gt;&gt;&gt;&gt; However, neither in the Smalltalk code nor in the generated C code I was able<br>
&gt;&gt;&gt;&gt; to find any uses of this.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; SqueakVMMaker/src ??? grep -iR readImageFromFileHeapSizeStartingAt *<br>
&gt;&gt;&gt;&gt; vm/interp.c:sqInt  readImageFromFileHeapSizeStartingAt(sqImageFile  f, usqInt desiredHeapSize, squeakFileOffsetType  imageOffset);<br>
&gt;&gt;&gt;&gt; vm/interp.c:sqInt readImageFromFileHeapSizeStartingAt(sqImageFile  f, usqInt desiredHeapSize, squeakFileOffsetType  imageOffset) {<br>
&gt;&gt;&gt;&gt;<br>
</div>[…]<br>
<div class="im">&gt;&gt;<br>
&gt;&gt; The _purpose_ of the 512byte skip was clear to me.<br>
&gt;&gt; I was just puzzled that there is no reference to the indicated method whatsoever.<br>
&gt;&gt; Can you give me a hint, where that is used?<br>
&gt;<br>
&gt; I&#39;m away from Squeak at the moment, but look in class Interpreter<br>
&gt; in package VMMaker. I think the method is #readImageFromFile:HeapSize:StartingAt:<br>
&gt; or similar. The colons get removed from the method/function name as<br>
&gt; part of the translation to C.<br>
<br>
</div>Yes, that is true. I&#39;ve already found that, if you refer to my original post.<br>
My point is, that<br>
NEITHER the smalltalk method<br>
        Interpreter&gt;&gt;#readImageFromFile:HeapSize:StartingAt:<br>
NOR the c function<br>
<br>
is called at all:<br>
  No senders for the Smalltalk method, no reference when<br>
searching all methods source code for readImageFrom, aside the actual implementation<br>
and a mention in some ‘important methods’ collection.<br>
  For the C-function, refer to my grep inside the generated source tree. No call at all.<br>
<br>
So, why are they existent, in the first place?<br></blockquote><div><br></div><div>You&#39;re not searching all the C code ;)  readImageFromFile:HeapSize:StartingAt: is called from the C main routine, and the C main routine is not generated.  See platforms/{Mac OS,iOS,win32,unix}/vm</div>
<div> </div><div><div>McStalker.oscogvm$ grep readImageFromFile platforms/*/vm/*</div><div>platforms/Cross/vm/sq.h:sqInt readImageFromFileHeapSizeStartingAt(sqImageFile f, usqInt desiredHeapSize, squeakFileOffsetType imageOffset);</div>
<div>platforms/Cross/vm/sq.h:#define readImageFromFileHeapSize(f, s) readImageFromFileHeapSizeStartingAt(f,s,0)</div><div>platforms/Mac OS/vm/sqMacMain.c:        readImageFromFileHeapSizeStartingAt(f, sqGetAvailableMemory(), 0);</div>
<div>platforms/Mac OS/vm/sqMacNSPluginUILogic.c:     readImageFromFileHeapSizeStartingAt(f, squeakHeapMBytes, 0);</div><div>platforms/unix/vm/sqUnixMain.c:      readImageFromFileHeapSizeStartingAt(f, extraMemory, 0);</div>
<div>platforms/win32/vm/sqWin32Intel.c:      readImageFromFileHeapSizeStartingAt(imageFile, virtualMemory, 0);</div><div>platforms/win32/vm/sqWin32Intel.c:      readImageFromFileHeapSizeStartingAt(imageFile, virtualMemory, sqImageFilePosition(imageFile));</div>
</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
So Long<br>
<font color="#888888">        -Tobias</font></blockquote></div><br>