[erlang-questions] 64-bit erlang
Sat Dec 1 05:54:38 CET 2007
Aren't the pointers inside the VM always 32-bit aligned? Then just right-shift the pointer 2 bits and store the lower 32 bits of that. That will ramp the addressable range from 4GB to 16GB.
It is a little fiddly to work with (and you'd have to make sure every pointer load/store does the conversion or else it'll corrupt (hello codegen)), but since it's the same 32-bit memory bandwidth/footprint and the register shifting could happen for free with the right asm output from compiler optimization, there might be no hit at all.
You'd also have to check to make sure that all the heap allocations are below 0x0000 0004 0000 0000, but that's also very minimal overhead as well as I presume malloc()s are seldom and in large banks at a time.
This would really be a stop-gap solution only for people working with>4GB in-RAM datasets (like me!), but as others have said it's a shame that this is so painful. Back in the 16 -> 32 bit conversion, 16-bit computers were already well above the 16-bit address range with banking and segments and whatnot. Now, 32-bit systems are only approaching or right at their limit so doubling the pointer size really hurts for large apps. Since the AMD64 ISA can run so much faster than IA32, we get 64-bit pointer sizes pushed on us before it's truly necessary and the industry has skipped exposing a segment/banked 32-bit system to developers, which arguably could be more useful for 4-16GB systems.
Put your friends on the big screen with Windows Vista® + Windows Live™.
More information about the erlang-questions