« Return to Thread: Tagging
You don't need to shift the numbers for addition and subtraction, just
make sure the bottom bits are 0. Even with the tag being 1, you
only need to detag one argument and if that's a constant the
detagging can be done at compile time.
With multiplication and division only one argument needs to be
shifted.
It was used by some Lisp systems in the mid 80's. I think CMU Common
Lisp from memory.
There are two disadvantages of using the top bit:
1) You need to control the address space to make sure all objects
live. Controlling the address space to that degree is unlikely to
be something that can be done portably.
2) You loose half your address space.
Alignment. Words are aligned to 4 byte boundaries which is always
required for performance and required by some CPU architectures.
There is a large literature on garbage collection. These day's I'd try
citeseer as well as Google. Scanning PLDI and OOPSLA proceedings from
the late 70s and 80s will provide plenty of information if you've
either got ACM membership or access to a university library.
Bryce
« Return to Thread: Tagging
| Free Forum Powered by Nabble | Forum Help |