Do shared libraries use the same heap as the application?

后端 未结 2 1050
无人共我
无人共我 2020-12-13 00:57

Say I have an application in Linux that uses shared libraries (.so files). My question is whether the code in those libraries will allocate memory in the same h

2条回答
  •  半阙折子戏
    2020-12-13 01:12

    Symbol tables are shared across an entire process in Linux. malloc() for any part of the process is the same as all the other parts. So yes, if all parts of a process access the heap via malloc() et alia then they will share the same heap.

提交回复
热议问题