gpt4 book ai didi

windows - Windows x64 的 44 位虚拟内存地址限制的背后

转载 作者:可可西里 更新时间:2023-11-01 09:56:44 24 4
gpt4 key购买 nike

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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com