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