开发者

On Windows, can data in memory ever exist continuously across virtual memory pages?

开发者 https://www.devze.com 2023-03-07 07:57 出处:网络
On Windows, can data in memory ever exist continuously across virtual memory pages? For example, The string \"hello\", where \"he\" on one page and \"llo\" is on the next.

On Windows, can data in memory ever exist continuously across virtual memory pages?

For example,

  • The string "hello", where "he" on one page and "llo" is on the next.
  • Any large block of data that exceeds max page size, if poss开发者_StackOverflow中文版ible.


Of course.

Memory pages might not appear contiguously in physical memory, but through the magic of virtual memory your program is none the wiser.


VirtualQueryEx doesn't return individual pages, but ranges of pages having the same access. If you're asking whether a string could span two pages with different access, theoretically yes, but this would in general be VERY rare. It's more likely that the string you want is swapped out to disk.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号