Hi guys. There is something I still don't understand about ImageSegment hahaha. But each time there is less :)<br><br>There is a place in ImageSegment >> copyObj: oop toSegment: segmentWordArray addr: lastSeg stopAt: stopAddr saveOopAt: oopPtr headerAt: hdrPtr<br>
where it does this:<br><br> self forward: oop to: (lastSeg+BytesPerWord + extraSize - segmentWordArray)<br> savingOopAt: oopPtr andHeaderAt: hdrPtr.<br><br><br>Basically, it forwards oop to another address which is actually the offset inside the segment. And it backups the original oop and the hader, as you can see here:<br>
<br>Interpreter >> forward: oop to: newOop savingOopAt: oopPtr andHeaderAt: hdrPtr<br><br> "Make a new entry in the table of saved oops."<br> self longAt: oopPtr put: oop. "Save the oop"<br>
self longAt: hdrPtr put: (self longAt: oop). "Save the old header word"<br><br> "Put a forwarding pointer in the old object, flagged with forbidden header type"<br> self longAt: oop put: newOop + HeaderTypeFree.<br>
<br><br>Now....the line I don't understand is this:<br><br> self longAt: oop put: newOop + HeaderTypeFree.<br>
<br>Because 'self longAt: oop' <br>will answer the object header of oop. And there, it stores a number (the offset). Is this possible?<br><br>In addition, it not only stores the offset, by it plus the flag HeaderTypeFree.<br>
<br>I really don't understand how you can plus an offset and the flag. What is the result? how should I interpret that?<br><br>Thanks for any hint you can give me.<br><br>Mariano<br><br>