Re: Are array members guaranteed to be contiguous in physical memory?
From: Goran Larsson (hoh_at_invalid.invalid)
Date: 11/29/04
- Next message: Jens.Toerring_at_physik.fu-berlin.de: "Re: reformatting strings and memory issue"
- Previous message: Michael Wojcik: "Re: Typecasting Pointers"
- In reply to: Richard Bos: "Re: Are array members guaranteed to be contiguous in physical memory?"
- Next in thread: CBFalconer: "Re: Are array members guaranteed to be contiguous in physical memory?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 29 Nov 2004 16:00:32 GMT
In article <41ab3e32.438548648@news.individual.net>,
Richard Bos <rlb@hoekstra-uitgeverij.nl> wrote:
> > I just wonder if array members guaranteed to be contiguous in
> > physical memory
>
> Yes. The Standard demands it.
Chapter and verse, please.
In 6.2.5 clause 20 the Standard guarantees that the array is
contiguously allocated, but the memory is the memory of the abstract
machine described in 5.1.2.3, not the physical memory of the hosting
environment.
> Probably because the ISO C Committee thought (rightly, IMO), that the
> opposite would be a major pain in the backside.
Demanding that array members be contiguous in physical memory must be a
terrible burden on the compiler runtime environment as it has to have
knowledge about how to request contiguous physical memory from the
execution environment. I have never seen this done for ordinary array
members.
-- Göran Larsson http://www.mitt-eget.com/
- Next message: Jens.Toerring_at_physik.fu-berlin.de: "Re: reformatting strings and memory issue"
- Previous message: Michael Wojcik: "Re: Typecasting Pointers"
- In reply to: Richard Bos: "Re: Are array members guaranteed to be contiguous in physical memory?"
- Next in thread: CBFalconer: "Re: Are array members guaranteed to be contiguous in physical memory?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|