Peter Steinle writes:
> Is the memory assigned by an allocate statement guaranteed to be
> continuous ?
The simple answer is "yes". This is a good enough answer for most
practical purposes.
For the pedantic, the answer is that the standard doesn't specify
implementation at that level. The standard just specifies how things
have to work. In this case, things have to work in such a way that
you wouldn't be able to tell the difference from it being continuous
(or contiguous, which is a slightly more appropriate term).
To illustrate the pedantic point, there are good odds that the
memory allocated on the machines you used is not, in fact,
contiguous, but that you failed to notice the difference.
I suspect that the memory management function of your hardware
mapped discontiguous chunks of physical memory onto contiguous
chunks of virtual memory.
And if you are working in a shared memory multiprocessing environment,
the question becomes more complicated. I don't know all the details
of those kinds of environments, but I'm sure they make questions like
this more subtle.
But to return to the simple answer...yes. If you are doing something
where this answer isn't good enough, you'll know.
--
Richard Maine | Good judgment comes from experience;
[log in to unmask] | experience comes from bad judgment.
| -- Mark Twain
|