Commit 2d03b73
authored
The remove_subclass() function now deletes the dictionary when
removing the last subclass (if the dictionary becomes empty) to save
memory: set PyTypeObject.tp_subclasses to NULL. remove_subclass() is
called when a type is deallocated.
_PyType_GetSubclasses() no longer holds a reference to tp_subclasses:
its loop cannot modify tp_subclasses.
1 parent f1c6ae3 commit 2d03b73
2 files changed
+32
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4923 | 4923 | | |
4924 | 4924 | | |
4925 | 4925 | | |
| 4926 | + | |
| 4927 | + | |
| 4928 | + | |
| 4929 | + | |
| 4930 | + | |
| 4931 | + | |
| 4932 | + | |
| 4933 | + | |
| 4934 | + | |
| 4935 | + | |
| 4936 | + | |
| 4937 | + | |
| 4938 | + | |
| 4939 | + | |
| 4940 | + | |
| 4941 | + | |
| 4942 | + | |
4926 | 4943 | | |
4927 | 4944 | | |
4928 | 4945 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4137 | 4137 | | |
4138 | 4138 | | |
4139 | 4139 | | |
4140 | | - | |
4141 | | - | |
4142 | | - | |
| 4140 | + | |
| 4141 | + | |
4143 | 4142 | | |
4144 | 4143 | | |
4145 | | - | |
| 4144 | + | |
| 4145 | + | |
| 4146 | + | |
4146 | 4147 | | |
4147 | 4148 | | |
4148 | 4149 | | |
4149 | | - | |
| 4150 | + | |
4150 | 4151 | | |
4151 | 4152 | | |
4152 | 4153 | | |
4153 | 4154 | | |
4154 | 4155 | | |
4155 | 4156 | | |
4156 | 4157 | | |
4157 | | - | |
4158 | | - | |
| 4158 | + | |
| 4159 | + | |
4159 | 4160 | | |
4160 | 4161 | | |
4161 | | - | |
4162 | | - | |
4163 | 4162 | | |
4164 | 4163 | | |
4165 | 4164 | | |
| |||
6568 | 6567 | | |
6569 | 6568 | | |
6570 | 6569 | | |
| 6570 | + | |
| 6571 | + | |
| 6572 | + | |
| 6573 | + | |
| 6574 | + | |
| 6575 | + | |
| 6576 | + | |
6571 | 6577 | | |
6572 | 6578 | | |
6573 | 6579 | | |
| |||
0 commit comments