- 论坛徽章:
- 0
|
他是在编译器编译的时候初始化的, 大部分编译器是这么做的.
如gcc
看到这么一段话, 不知对你有帮助没有
The BSS section is where compilers typically put static objects that don’t
have an explicit initial value. In modern operating systems
like Windows and Linux, the OS allows the compiler/linker to put all uninitialized
variables into a BSS section that simply tells the OS how many bytes
to set aside for that section. When the operating system loads the program
into memory, it reserves sufficient memory for all the objects in the BSS section
and fills this range of memory with zeros. It is important to note that the
BSS section in the executable file doesn’t contain any actual data. For this
reason, programs that declare large uninitialized static arrays in a BSS section
will consume less disk space.
[ 本帖最后由 piaoyizu 于 2008-5-2 10:56 编辑 ] |
|