In C++, the local variables are stored in stack, while the datas created by new operator are stored in heap. So, what about the variables in Python? Where are they stored?
2624 次
1 回答
6
从Python 文档中复制:
Python 中的内存管理涉及一个包含所有 Python 对象和数据结构的私有堆。这个私有堆的管理由 Python 内存管理器在内部确保。Python 内存管理器具有处理各种动态存储管理方面的不同组件,例如共享、分段、预分配或缓存。
于 2013-07-20T18:03:03.503 回答