Regarding the bss segment and data segment in Unix

后端 未结 2 1485
孤街浪徒
孤街浪徒 2020-12-30 15:38

I read in my unix text book that bss is used to store the uninitialized variables(global declarations). This would mean that the static variables are stored separately and n

2条回答
  •  一整个雨季
    2020-12-30 16:11

    bss is traditionally the so-called uninitialized variables, but C and Unix guarantee they are initialized to zero. (See this.) It is a portion of the data segment, usually right after the program-statically-initialized-variable space. Just higher in memory than bss is usually the beginning of the heap.

提交回复
热议问题