summaryrefslogtreecommitdiffstats
path: root/Modules/_weakref.c
Commit message (Collapse)AuthorAgeFilesLines
* _PyWeakref_GetWeakrefCount() now returns a Py_ssize_t instead of long.Neal Norwitz2006-08-021-3/+3
|
* Make weak references subclassable:Fred Drake2004-07-021-22/+3
| | | | | | | | | | | | | | | | | | | | | | - weakref.ref and weakref.ReferenceType will become aliases for each other - weakref.ref will be a modern, new-style class with proper __new__ and __init__ methods - weakref.WeakValueDictionary will have a lighter memory footprint, using a new weakref.ref subclass to associate the key with the value, allowing us to have only a single object of overhead for each dictionary entry (currently, there are 3 objects of overhead per entry: a weakref to the value, a weakref to the dictionary, and a function object used as a weakref callback; the weakref to the dictionary could be avoided without this change) - a new macro, PyWeakref_CheckRefExact(), will be added - PyWeakref_CheckRef() will check for subclasses of weakref.ref This closes SF patch #983019.
* Fix ref(), proxy() docstrings, based on comments from David Abrahams.Fred Drake2002-08-021-3/+4
|
* Excise DL_EXPORT/DL_IMPORT from Modules/*. Required adding a prototypeMark Hammond2002-08-021-1/+1
| | | | | | for Py_Main(). Thanks to Kalle Svensson and Skip Montanaro for the patches.
* Patch #568124: Add doc string macros.Martin v. Löwis2002-06-131-8/+8
|
* Convert the ref() and proxy() implementations to use the newFred Drake2001-10-231-2/+2
| | | | PyArg_UnpackTuple() function (serves as an example and test case).
* Adjust the _weakref module to use the public API for the weak referenceFred Drake2001-10-051-717/+15
| | | | | objects. This is now simply a shim to give weakref.py access to the underlying implementation.
* Use new GC API.Neil Schemenauer2001-08-291-10/+10
|
* Use METH_O where possible (two functions). This does not lead to realFred Drake2001-08-161-29/+24
| | | | | performance changes since the affected functions are not expected to be used frequently, but reduces the volume of code.
* Remove an obsolete comment and a "return" before fallig off the end of aFred Drake2001-05-031-2/+0
| | | | void function.
* cleanup_helper(): Make sure we invalidate all reference objectsFred Drake2001-04-131-6/+41
| | | | | | | | | | | before calling any callbacks. This is important since the callback objects only look at themselves to determine that they are invalide. This change avoids a segfault when callbacks use a different reference to an object in the process of being deallocated. This fixes SF bug #415660.
* Revert the 1.8 patch, since it's implicated in nasty blowups (see Pyhon-Dev).Tim Peters2001-03-231-1/+1
|
* Inform the cycle-detector that the a weakref object no longer needs to beFred Drake2001-03-221-1/+1
| | | | | | tracked as soon as it is clear; this can decrease the number of roots for the cycle detector sooner rather than later in applications which hold on to weak references beyond the time of the invalidation.
* Patch #403985: Add support for weak-keyed dictionariesMartin v. Löwis2001-02-271-2/+40
|
* cleanup_helper(): Added missing "void" type for the function, updatedFred Drake2001-02-261-6/+3
| | | | comments to reflect reality.
* The return value from PyObject_ClearWeakRefs() is no longer meaningful,Fred Drake2001-02-261-3/+3
| | | | so make it void.
* Move docstrings out of function table to constants defined near theFred Drake2001-02-181-11/+23
| | | | function implementations.
* Repair legit compiler warning.Tim Peters2001-02-021-1/+1
|
* Teach Windows build about the _weakref module.Tim Peters2001-02-021-1/+1
|
* PEP 205, Weak References -- initial checkin.Fred Drake2001-02-011-0/+757