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 に答える