Create a sufficiently nested container object so that the trashcan mechanism is invoked when deallocating it.
()
| 496 | # to call list_dealloc, which also uses the trashcan mechanism. |
| 497 | |
| 498 | def make_nested(): |
| 499 | """Create a sufficiently nested container object so that the |
| 500 | trashcan mechanism is invoked when deallocating it.""" |
| 501 | x = C([]) |
| 502 | for i in range(NESTING): |
| 503 | x = [C([x])] |
| 504 | del x |
| 505 | |
| 506 | def run_thread(): |
| 507 | """Exercise make_nested() in a loop.""" |