【发布时间】:2016-08-11 11:49:58
【问题描述】:
http://man7.org/linux/man-pages/man2/mmap.2.html 说
MAP_ANONYMOUS
The mapping is not backed by any file; its contents are
initialized to zero.
为什么需要将内容初始化为零?我认为这可能相当昂贵。
【问题讨论】:
http://man7.org/linux/man-pages/man2/mmap.2.html 说
MAP_ANONYMOUS
The mapping is not backed by any file; its contents are
initialized to zero.
为什么需要将内容初始化为零?我认为这可能相当昂贵。
【问题讨论】:
新分配的页面用零填充,以避免敏感信息从其他进程泄漏。例如,这些进程可能已经在其中存储了密码,如果该内存没有被覆盖,则其内容会泄漏到其他地方。
【讨论】: