Re: static, global variable memory allocation



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.
.



Relevant Pages

  • Re: static, global variable memory allocation
    ... Flash Gordon wrote: ... before I started programming on Unix, ... 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? ...
    (comp.lang.c)
  • [EXPL] Mozilla Browsers Remote Heap Buffer Overrun (Exploit , 0xAD HOST)
    ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... A heap buffer overrun vulnerability exists in Mozilla browsers, ... of the string to create more large heap blocks. ... var startDate = new Date; ...
    (Securiteam)
  • Re: where? heap or stack?
    ... >>refer to standard data structures, ... stack & the heap in the idiomatic way. ... these terms in a news group posting, someone likely will get very huffy ...
    (comp.lang.cpp)
  • Re: set theory : the blunder
    ... is meaningless (at least in standard math lingo). ... is a name/term referring to a heap. ... heaps certainly do NOT behave like bags. ... If you want to refer to the heap which has ...
    (sci.math)
  • Re: Heap Size
    ... how can I determine/Change size of heap on per- ... process basis on Unix based systems. ... int main ...
    (comp.lang.c)