On Windows, can data in memory ever exist continuously across virtual memory pages?
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.
精彩评论