http://www.alex-ionescu.com/?p=50 。
我读了上面的帖子。作者以单链表为例解释了为什么Windows x64仅支持44位虚拟内存地址。
struct { // 8-byte header ULONGLONG Depth:16; ULONGLONG Sequence:9; ULONGLONG NextEntry:39; } Header8;
The first sacrifice to make was to reduce the space for the sequence number to 9 bits instead of 16 bits, reducing the maximum sequence number the list could achieve. This still only left 39 bits for the pointer — a mediocre improvement over 32 bits. By forcing the structure to be 16-byte aligned when allocated, 4 more bits could be won, since the bottom bits could now always be assumed to be 0.
哦,我听不懂。
什么“通过在分配时强制结构进行 16 字节对齐,可以多赢得 4 位,因为现在可以始终假定底部位为 0。”方法?
最佳答案
16 is 0010000 in binary
32 is 0100000 in binary
64 is 1000000 in binary
等等
您可以看到,对于所有 16 的倍数的数字,最后四位始终为零。 因此,您可以将它们保留下来,并在需要使用指针时将它们添加回来,而不是存储这些位。
关于windows - Windows x64 的 44 位虚拟内存地址限制背后,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4563297/