Thanks Bryce and Andrew for your quick and informative responses. Comments/questions below.<br><br><div><span class="gmail_quote">On 8/4/07, <b class="gmail_sendername"><a href="mailto:bryce@kampjes.demon.co.uk">bryce@kampjes.demon.co.uk
</a></b> <<a href="mailto:bryce@kampjes.demon.co.uk">bryce@kampjes.demon.co.uk</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>You don't need to shift the numbers for addition and subtraction, just<br>make sure the bottom bits are 0. Even with the tag being 1, you<br>only need to detag one argument and if that's a constant the<br>detagging can be done at compile time.
<br><br>With multiplication and division only one argument needs to be<br>shifted.</blockquote><div><br><br>Interesting. Well, I assume that in Smalltalk object access is much more often then integer access, but does anyone have any data that proves this? If it is the case then I guess that's the death of my MSB tagging idea. :)
<br><br>Doesn't Strongtalk use 0 tagged SmallIntegers? And if so, why? I looked in the source code a bit but I haven't figured out yet where that would be.<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>It was used by some Lisp systems in the mid 80's. I think CMU Common<br>Lisp from memory.<br><br>There are two disadvantages of using the top bit:<br>1) You need to control the address space to make sure all objects
<br>live. Controlling the address space to that degree is unlikely to<br>be something that can be done portably.<br>2) You loose half your address space.</blockquote><div><br><br>Well, I suppose I could shift the pointers up one (which would make the first bit zero) to reclaim the space, but as I believe it must be the case that object access is much more common then number access, that would be a bad trade-off.
<br></div><div> </div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Alignment. Words are aligned to 4 byte boundaries which is always<br>
required for performance and required by some CPU architectures.</blockquote><div><br><br>I see, I didn't realize the bottom 2 bits had to be zero. That answers a lot of my questions. :)<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
There is a large literature on garbage collection. These day's I'd try<br>citeseer as well as Google. Scanning PLDI and OOPSLA proceedings from<br>the late 70s and 80s will provide plenty of information if you've
<br>either got ACM membership or access to a university library.<br><br>Bryce</blockquote><div><br><br>I have the "Garbage Collection" book from Jones & Lins, but I will try to look on those sites as well. I just need to go to the "ACM digital library", no?
<br></div><br></div>