Wednesday, June 2, 2010

Bits or Symbols?

Coming from an academic background, you think in symbols first, and bits second, which shows in the runtime. I waste too much bits on constants, a header now consists of a size, a constant indicating it is a constant, a record type tag, a typ tag, and the value bits.

I should/could bit back type information into the header field. You need at least a size field, but 32 bits for the size is enough, and another 32 bits to point into an rtti information field should be good enough too...

It means little to the garbage collector, except that it would need to blank the upper 32 bits, possibly leave one bit to show it is an integer or pointer array.

Thing is, I've seen a lot of source code, and bit packing has a tendency to generate line noise.


No comments:

Post a Comment