Re: static, global variable memory allocation
- From: richard@xxxxxxxxxxxxxxx (Richard Tobin)
- Date: 6 Feb 2007 22:37:05 GMT
In article <octm94xchr.ln2@xxxxxxxxxxxxxxxxxxxxxxx>,
Flash Gordon <spam@xxxxxxxxxxxxxxxxxx> wrote:
I was now specifically aware of that, to be hones I gave up caring
before I started programming on Unix, but given:
static const char var[]="Static array";
Would you expect var to be in that area you refer to as a heap or, as I
would hope, in a separate memory region that was set to read only?
I'm not sure that the semantics of const allow it to be read-only, but
supposing it does, I'm not sure you couldn't say that part of the
heap was read-only. Equally part of it could be autmoatically zeroed.
On reflection, I agree it's probably better not to call the
statically-allocated data part of the heap.
-- Richard
--
"Consideration shall be given to the need for as many as 32 characters
in some alphabets" - X3.4, 1963.
.
- Follow-Ups:
- Re: static, global variable memory allocation
- From: Flash Gordon
- Re: static, global variable memory allocation
- References:
- static, global variable memory allocation
- From: fdmfdmfdm@xxxxxxxxx
- Re: static, global variable memory allocation
- From: Flash Gordon
- Re: static, global variable memory allocation
- From: Richard Tobin
- Re: static, global variable memory allocation
- From: Flash Gordon
- static, global variable memory allocation
- Prev by Date: [OT] Re: static, global variable memory allocation
- Next by Date: Re: static, global variable memory allocation
- Previous by thread: Re: static, global variable memory allocation
- Next by thread: Re: static, global variable memory allocation
- Index(es):
Relevant Pages
|
|