Hi Mark, On Sat 14 May 2011 00:08, Mark H Weaver <m...@netris.org> writes:
> Andy Wingo <wi...@pobox.com> writes: >> I'm looking at new SCM representation and tagging possibilities in 2.2. >> Read the whole mail please, as it's a little complicated. > > Unfortunately I don't have time to write a proper response right now, > but on 32-bit architectures, I expect that this will nearly double the > memory usage for typical programs, where pointers are by far the most > common object. You are right that it would be a negative point, though I don't think that it's as bad as you say; there are potential savings in immediate foreign pointers, shaving off type words from some heap values, etc. However, I realized that this isn't going to work on 32-bit, and for an unexpected reason: GC. The problem is that the low 32-bits can be interpreted as a pointer, so you need to tag those bits to make the payloads of immediate values like integers or characters not confusable with pointers, and that takes away any potential advantage (wider fixnum range for example). So, bummer. NaN-boxing is probably best on 64-bit machines though. Andy -- http://wingolog.org/