http://www.thefreedictionary.com/contiguous and learn something about it.
sequentially accessible. Addressable in a continuous way. Often (but not always) opaque( e.g. a high level object like TStringList can cover multiple pages from the OS and is STILL accessible in a continuous way.
I am aware of paging. And also that the address seen by the application has nothing todo with the physical address.
I am aware that
- an app can have memory at address 3GB, even if there is only 1GB of real mem
- if an app accesses memory at address X this can be anywhere within the real memory
That changes nothing of what I said.
Any memory accessed by the app must bi in its address space. (But can be mapped to anywhere within real memory)
If an app has a variable Foo at (virtual) address 0x40000000 then as long as foo is allocated, the same app can not have any other variable at that address. Otherwise the OS could not know what page to map to that address if it was accessed.
If the app has variables (of just a few bytes size) at (virtual addresses) 0x20000000 (0.5 GB), 0x40000000 , 0x60000000 and so on, then in is impossible to allocate a continuous (not native English, but pretty sure that is the word) block of memory that is bigger than 0.5GB, because any such block would have to contain one of those (virtual) addresses.
Swapping the current content of the memory at that virtual address to disk would not help, because the next time the app accesses it, it would be impossible to know which of the 2 variable (that both would (have to) contain the same (virtual) address) was accessed by the app.
var
a: array [0..999] of pbyte;
b : pbyte;
begin
// allocate a lot of memory in a very tricky pattern, then
a[0] := getmem(16); // assume OS return address 0x20000000
a[1] := getmem(16); // assume OS return address 0x40000000
// .... up to address 0xE0000000 (or whatever your OS can handle as maximum
b := getmem(0x40000000 ); // 1 GB
what address should B be at? So that "for i = 0 to 0x40000000 -1 do b
:= 0;" does at no time access any of the data pointed to by a