summaryrefslogtreecommitdiffstats
path: root/Modules/gcmodule.c
Commit message (Collapse)AuthorAgeFilesLines
* bpo-33597: Reduce PyGC_Head size (GH-7043)INADA Naoki2018-07-101-210/+369
|
* bpo-33622: Add checks for exceptions leaks in the garbage collector. (GH-7126)Serhiy Storchaka2018-05-291-4/+23
| | | | | * Failure in adding to gc.garbage is no longer fatal. * An exception in tp_clear() no longer lead to crash (though tp_clear() should not leave exceptions).
* bpo-33622: Fix issues with handling errors in the GC. (GH-7078)Serhiy Storchaka2018-05-241-8/+11
| | | | | | | * Fixed a leak when the GC fails to add an object with __del__ into the gc.garbage list. * PyGC_Collect() can now be called when an exception is set and preserves it. * Fixed an undefined behavior with comparing a dead pointer with NULL.
* bpo-33583: Add note in PyObject_GC_Resize() doc (GH-7021)INADA Naoki2018-05-211-0/+1
|
* Revert "bpo-31356: Add context manager to temporarily disable GC GH-5495Yury Selivanov2018-02-021-106/+0
| | | | | | | This reverts commit 72a0d218dcc94a3cc409a9ef32dfcd5a7bbcb43c. The reverted commit had a few issues so it was unanimously decided to undo it. See the bpo issue for details.
* bpo-31356: Add context manager to temporarily disable GC (GH-4224)Pablo Galindo2018-01-291-0/+106
|
* bpo-32436: Implement PEP 567 (#5027)Yury Selivanov2018-01-231-0/+2
|
* bpo-9566: Fix size_t=>int downcast warnings (#5230)Victor Stinner2018-01-181-3/+3
| | | | * Use wider types (int => Py_ssize_t) to avoid integer overflows. * Fix gc.get_freeze_count(): use Py_ssize_t type rather than int, since gc_list_size() returns a Py_ssize_t.
* Add the const qualifier to "char *" variables that refer to literal strings. ↵Serhiy Storchaka2017-11-111-1/+1
| | | | (#4370)
* bpo-31558: Add gc.freeze() (#3705)brainfvck2017-10-161-1/+63
| | | | | Freeze all the objects tracked by gc - move them to a permanent generation and ignore all the future collections. This can be used before a POSIX fork() call to make the gc copy-on-write friendly or to speed up collection.
* bpo-30860: Consolidate stateful runtime globals. (#3397)Eric Snow2017-09-081-213/+98
| | | | | | | * group the (stateful) runtime globals into various topical structs * consolidate the topical structs under a single top-level _PyRuntimeState struct * add a check-c-globals.py script that helps identify runtime globals Other globals are excluded (see globals.txt and check-c-globals.py).
* Revert "bpo-30860: Consolidate stateful runtime globals." (#3379)Eric Snow2017-09-061-96/+213
| | | Windows buildbots started failing due to include-related errors.
* bpo-30860: Consolidate stateful runtime globals. (#2594)Eric Snow2017-09-061-213/+96
| | | | | | | | | * group the (stateful) runtime globals into various topical structs * consolidate the topical structs under a single top-level _PyRuntimeState struct * add a check-c-globals.py script that helps identify runtime globals Other globals are excluded (see globals.txt and check-c-globals.py).
* Issue #20185: Converted the gc module to Argument Clinic.Serhiy Storchaka2017-02-041-98/+132
|
* Issue #28999: Use Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE whereverSerhiy Storchaka2017-01-231-8/+4
| | | | possible. Patch is writen with Coccinelle.
* Backed out changeset b9c9691c72c5Victor Stinner2016-12-041-1/+1
| | | | | | Issue #28858: The change b9c9691c72c5 introduced a regression. It seems like _PyObject_CallArg1() uses more stack memory than PyObject_CallFunctionObjArgs().
* Replace PyObject_CallFunctionObjArgs() with fastcallVictor Stinner2016-12-011-1/+1
| | | | | | | | | | | | | | * PyObject_CallFunctionObjArgs(func, NULL) => _PyObject_CallNoArg(func) * PyObject_CallFunctionObjArgs(func, arg, NULL) => _PyObject_CallArg1(func, arg) PyObject_CallFunctionObjArgs() allocates 40 bytes on the C stack and requires extra work to "parse" C arguments to build a C array of PyObject*. _PyObject_CallNoArg() and _PyObject_CallArg1() are simpler and don't allocate memory on the C stack. This change is part of the fastcall project. The change on listsort() is related to the issue #23507.
* Don't run garbage collection on interpreter exit if it was explicitly disabledŁukasz Langa2016-09-101-0/+9
| | | | by the user.
* DTrace support: function calls, GC activity, line executionŁukasz Langa2016-09-101-0/+8
| | | | | | | | | | | | | | | | | | | Tested on macOS 10.11 dtrace, Ubuntu 16.04 SystemTap, and libbcc. Largely based by an initial patch by Jesús Cea Avión, with some influence from Dave Malcolm's SystemTap patch and Nikhil Benesch's unification patch. Things deliberately left out for simplicity: - ustack helpers, I have no way of testing them at this point since they are Solaris-specific - PyFrameObject * in function__entry/function__return, this is SystemTap-specific - SPARC support - dynamic tracing - sys module dtrace facility introspection All of those might be added later.
* Issue #28003: Implement PEP 525 -- Asynchronous Generators.Yury Selivanov2016-09-091-0/+1
|
* Issue #25923: Added more const qualifiers to signatures of static and ↵Serhiy Storchaka2015-12-251-1/+1
| | | | private functions.
* Issue #22117: The gc module now uses _PyTime_t timestampVictor Stinner2015-03-271-6/+6
|
* Issue #22043: time.monotonic() is now always availableVictor Stinner2014-09-021-3/+3
| | | | | threading.Lock.acquire(), threading.RLock.acquire() and socket operations now use a monotonic clock, instead of the system clock, when a timeout is used.
* Cleanup other stats formatting code in gcmodule.cAntoine Pitrou2014-05-241-5/+3
|
* Issue #21555: simplify code in gcmodule.c by using the pytime.h functions ↵Antoine Pitrou2014-05-241-41/+9
| | | | | | instead of trying to call time.time() via the C API. Patch by Geoffrey Spear.
* Merge from 3.4.Tim Peters2014-05-081-11/+23
|\ | | | | | | | | | | Issue #21435: Segfault in gc with cyclic trash Changed the iteration logic in finalize_garbage() to tolerate objects vanishing from the list as a side effect of executing a finalizer.
| * Issue #21435: Segfault in gc with cyclic trashTim Peters2014-05-081-11/+23
| | | | | | | | | | Changed the iteration logic in finalize_garbage() to tolerate objects vanishing from the list as a side effect of executing a finalizer.
* | Issue #21233: Add new C functions: PyMem_RawCalloc(), PyMem_Calloc(),Victor Stinner2014-05-021-4/+20
|/ | | | | | PyObject_Calloc(), _PyObject_GC_Calloc(). bytes(int) and bytearray(int) are now using ``calloc()`` instead of ``malloc()`` for large objects which is faster and use less memory (until the bytearray buffer is filled with data).
* Issue #20315: Removed support for backward compatibility with early 2.x ↵Serhiy Storchaka2014-01-201-14/+0
|\ | | | | | | | | | | | | versions. Removed backward compatibility alias curses.window.nooutrefresh which should be removed in 2.3.
| * Issue #20315: Removed support for backward compatibility with early 2.x ↵Serhiy Storchaka2014-01-201-14/+0
| | | | | | | | versions.
| * remove trailing spaces.Gregory P. Smith2013-12-181-7/+7
| |
* | whatsnew for gc.get_stats, plus doc tweaks.R David Murray2013-12-261-0/+1
| | | | | | | | | | | | | | | | | | | | Clarified the "At the moment" wording, and added the get_stats entry in the module summary that Serhiy noted was missing at the end of issue 16351. Given that pydoc lists all the function docstrings, I'm not sure that module summary section is actually needed; but, it is probably better to address that when the module is converted to use Argument Clinic. In the meantime we should keep the list complete.
* | Replace an overly optimistic assert() in _PyGC_CollectNoFail with a simple ↵Antoine Pitrou2013-08-151-6/+13
| | | | | | | | guard.
* | In _PyGC_Fini(), lose the reference that was kept to the time moduleAntoine Pitrou2013-08-061-0/+1
| |
* | Issue #18112: PEP 442 implementation (safe object finalization).Antoine Pitrou2013-07-301-49/+107
| |
* | Issue #18408: PyObject_GC_NewVar() now raises SystemError exception if nitemsVictor Stinner2013-07-081-2/+9
| | | | | | | | is negative
* | gcmodule.c: strip trailing spacesVictor Stinner2013-07-081-7/+7
| |
* | Issue #17937: Try harder to collect cyclic garbage at shutdown.Antoine Pitrou2013-05-181-6/+25
| |
* | Backout c89febab4648 following private feedback by Guido.Antoine Pitrou2013-05-141-1/+4
| | | | | | | | (Issue #17807: Generators can now be finalized even when they are part of a reference cycle)
* | Issue #17807: Generators can now be finalized even when they are part of a ↵Antoine Pitrou2013-05-081-4/+1
| | | | | | | | reference cycle.
* | Issue #1545463: At shutdown, defer finalization of codec modules so that ↵Antoine Pitrou2013-05-081-3/+7
| | | | | | | | | | | | stderr remains usable. (should fix Windows buildbot failures on test_gc)
* | Issue #1545463: Global variables caught in reference cycles are now ↵Antoine Pitrou2013-05-061-1/+7
| | | | | | | | garbage-collected at shutdown.
* | Issue #16351: New function gc.get_stats() returns per-generation collection ↵Antoine Pitrou2012-10-301-0/+64
|/ | | | statistics.
* Issue #14775: Fix a potential quadratic dict build-up due to the garbage ↵Antoine Pitrou2012-05-281-3/+57
|\ | | | | | | | | | | collector repeatedly trying to untrack dicts. Additional comments by Tim Silk.
| * Issue #14775: Fix a potential quadratic dict build-up due to the garbage ↵Antoine Pitrou2012-05-281-3/+57
| | | | | | | | | | | | collector repeatedly trying to untrack dicts. Additional comments by Tim Silk.
* | Issue #10576: Add a progress callback to gcmoduleKristján Valur Jónsson2012-04-151-6/+74
| |
* | Remove unused variable from gcmodule.c. The code no longer tests for theKristján Valur Jónsson2012-04-081-9/+0
| | | | | | | | presence of a __del__ attribute on objects, rather it uses the tp_del slot.
* | Issue #6695: Full garbage collection runs now clear the freelist of set objects.Antoine Pitrou2011-12-161-0/+1
| | | | | | | | Initial patch by Matthias Troffaes.
* | Issue #13389: Full garbage collection passes now clear the freelists forAntoine Pitrou2011-11-141-0/+2
| | | | | | | | | | list and dict objects. They already cleared other freelists in the interpreter.
* | Rename _Py_identifier to _Py_IDENTIFIER.Martin v. Löwis2011-10-141-1/+1
| |