Memory initialization (not)

John Fine johnsfine@verizon.net
Tue Sep 30 13:55:00 GMT 2008


Jim Dougherty wrote:
> I have a section of memory that I do not want to be initialized with 
> zeros when my program starts.
> Is there a way to achieve this?
>
>
Why and/or what do you want to have happen instead?

For example:

1) You want to violate security and have you program able to read the 
discarded memory contents left over by some previous program.

2) You want to map and use some specific section of physical memory, 
such as an I/O mapped area.

3) You want demand zeroed memory (instead of when your program starts):  
The OS well fill each page of such memory with zeroes only when that 
page is accessed, not all such pages at the start of the program.

4) You want all the memory filled with something else.

My main point is that saying what you DON'T WANT is too vague.



More information about the Gcc-help mailing list