Mercurial > cpython-lru_cache-weakref
comparison Python/pythonrun.c @ 37831:d82dced6f1fa legacy-trunk
Remove types from type_list if they have no objects
and unlist_types_without_objects is set.
Give dump_counts a FILE* argument.
| author | Martin v. Löwis <martin@v.loewis.de> |
|---|---|
| date | Tue, 18 Apr 2006 06:24:08 +0000 |
| parents | 2f3f2e32dfd9 |
| children | 35f27bbd9ad8 |
comparison
equal
deleted
inserted
replaced
| 37830:e892b5442835 | 37831:d82dced6f1fa |
|---|---|
| 309 Py_InitializeEx(1); | 309 Py_InitializeEx(1); |
| 310 } | 310 } |
| 311 | 311 |
| 312 | 312 |
| 313 #ifdef COUNT_ALLOCS | 313 #ifdef COUNT_ALLOCS |
| 314 extern void dump_counts(void); | 314 extern void dump_counts(FILE*); |
| 315 #endif | 315 #endif |
| 316 | 316 |
| 317 /* Undo the effect of Py_Initialize(). | 317 /* Undo the effect of Py_Initialize(). |
| 318 | 318 |
| 319 Beware: if multiple interpreter and/or thread states exist, these | 319 Beware: if multiple interpreter and/or thread states exist, these |
| 371 * XXX in <function callback at 0x008F5718> ignored | 371 * XXX in <function callback at 0x008F5718> ignored |
| 372 * XXX but I'm unclear on exactly how that one happens. In any case, | 372 * XXX but I'm unclear on exactly how that one happens. In any case, |
| 373 * XXX I haven't seen a real-life report of either of these. | 373 * XXX I haven't seen a real-life report of either of these. |
| 374 */ | 374 */ |
| 375 PyGC_Collect(); | 375 PyGC_Collect(); |
| 376 #ifdef COUNT_ALLOCS | |
| 377 /* With COUNT_ALLOCS, it helps to run GC multiple times: | |
| 378 each collection might release some types from the type | |
| 379 list, so they become garbage. */ | |
| 380 while (PyGC_Collect() > 0) | |
| 381 /* nothing */; | |
| 382 #endif | |
| 376 | 383 |
| 377 /* Destroy all modules */ | 384 /* Destroy all modules */ |
| 378 PyImport_Cleanup(); | 385 PyImport_Cleanup(); |
| 379 | 386 |
| 380 /* Collect final garbage. This disposes of cycles created by | 387 /* Collect final garbage. This disposes of cycles created by |
| 399 /* Destroy the database used by _PyImport_{Fixup,Find}Extension */ | 406 /* Destroy the database used by _PyImport_{Fixup,Find}Extension */ |
| 400 _PyImport_Fini(); | 407 _PyImport_Fini(); |
| 401 | 408 |
| 402 /* Debugging stuff */ | 409 /* Debugging stuff */ |
| 403 #ifdef COUNT_ALLOCS | 410 #ifdef COUNT_ALLOCS |
| 404 dump_counts(); | 411 dump_counts(stdout); |
| 405 #endif | 412 #endif |
| 406 | 413 |
| 407 PRINT_TOTAL_REFS(); | 414 PRINT_TOTAL_REFS(); |
| 408 | 415 |
| 409 #ifdef Py_TRACE_REFS | 416 #ifdef Py_TRACE_REFS |
