Home > OS >  Linux memory mapping, mapping, anonymous request binary zero coverage problem
Linux memory mapping, mapping, anonymous request binary zero coverage problem

Time:09-24

In "deep understanding of computer system" mentioned in the book, process stack and heap area of virtual memory is to use an anonymous file mapping, and the corresponding physical memory using binary zero coverage;

But in the use of C, malloc out space, its content is unknown, including on the stack space, if you don't initialize, its content is also unknown, is not 0, how do you explain, please book?

CodePudding user response:

Is under Linux system? Under Linux system should be 0

CodePudding user response:

Also said the book, on page 588, malloc don't initialize it returns the memory, the need to have dynamic memory initialization of an application can use calloc, it will be allocated memory initialized to 0, binary zeros sacrifice cover page is the first time in CPU references when virtual page in such an area,