Message194571
modules_by_index is a near-eternal store for extension modules. It is only collected at the end of interpreter shutdown, which is much too late for regular garbage collection. This patch proposes instead to store weak references in modules_by_index, so that extension modules can be collected in a normal way when they are removed from sys.modules.
The only gotcha is that PyState_FindModule returns a borrowed reference. With this change, it becomes really important to incref the returned reference as soon as possible. |
|
Date |
User |
Action |
Args |
2013-08-06 20:38:51 | pitrou | set | recipients:
+ pitrou, loewis, brett.cannon, ncoghlan, sbt, eric.snow |
2013-08-06 20:38:51 | pitrou | set | messageid: <1375821531.36.0.318072139637.issue18674@psf.upfronthosting.co.za> |
2013-08-06 20:38:51 | pitrou | link | issue18674 messages |
2013-08-06 20:38:51 | pitrou | create | |
|