summaryrefslogtreecommitdiffstats
path: root/Include/objimpl.h
Commit message (Collapse)AuthorAgeFilesLines
* Change _PyObject_GC_Resize to expect Py_ssize_t.Martin v. Löwis2006-02-161-1/+1
|
* Merge ssize_t branch.Martin v. Löwis2006-02-151-3/+3
|
* Fix PyGC_Collect() to be exported from the built DLL on Windows. (Fix givenBarry Warsaw2006-01-261-1/+1
| | | | by Matt Messier).
* [ 1243081 ] repair typosGeorg Brandl2005-07-221-1/+1
|
* Formalize that the Py_VISIT macro requires that the tp_traverseTim Peters2004-07-151-1/+5
| | | | implementation it's used in must give its arguments specific names.
* Documented the new Py_VISIT macro to simplify implementation ofJim Fulton2004-07-141-0/+10
| | | | tp_traverse handlers. (Tim made me do it. ;)
* - New C API PyGC_Collect(), same as calling gc.collect().Guido van Rossum2003-04-171-0/+3
| | | | | - Call this in Py_Finalize(). - Expand the Misc/NEWS text on PY_LONG_LONG.
* Excise DL_EXPORT from Include.Mark Hammond2002-08-121-20/+20
| | | | Thanks to Skip Montanaro and Kalle Svensson for the patches.
* Removed WITH_CYCLE_GC #ifdef-ery. Holes:Tim Peters2002-07-071-19/+0
| | | | | | + I'm not sure what to do about configure.in. Left it alone. + Ditto pyexpat.c. Fred or Martin will know what to do.
* Finished transitioning to using gc_refs to track gc objects' states.Tim Peters2002-07-021-3/+5
| | | | | | | This was mostly a matter of adding comments and light code rearrangement. Upon untracking, gc_next is still set to NULL. It's a cheap way to provoke memory faults if calling code is insane. It's also used in some way by the trashcan mechanism.
* Reserved another gc_refs value for untracked objects. Every live gcTim Peters2002-07-021-2/+10
| | | | | | | | | | | | object should now have a well-defined gc_refs value, with clear transitions among gc_refs states. As a result, none of the visit_XYZ traversal callbacks need to check IS_TRACKED() anymore, and those tests were removed. (They were already looking for objects with specific gc_refs states, and the gc_refs state of an untracked object can no longer match any other gc_refs state by accident.) Added more asserts. I expect that the gc_next == NULL indicator for an untracked object is now redundant and can also be removed, but I ran out of time for this.
* _PyGC_generation0 is now a pointerNeil Schemenauer2002-05-041-4/+4
|
* Moving pymalloc along.Tim Peters2002-04-281-75/+89
| | | | | | | | | | As threatened, PyMem_{Free, FREE} also invoke the object deallocator now when pymalloc is enabled (well, it does when pymalloc isn't enabled too, but in that case "the object deallocator" is plain free()). This is maximally backward-compatible, but it leaves a bitter aftertaste. Also massive reworking of comments.
* _PyObject_DebugDumpStats: renamed to _PyObject_DebugMallocStats.Tim Peters2002-04-131-1/+1
| | | | | | Added code to call this when PYMALLOC_DEBUG is enabled, and envar PYTHONMALLOCSTATS is set, whenever a new arena is obtained and once late in the Python shutdown process.
* First cut at repairing out-of-date comments; make alignment of macro defsTim Peters2002-04-121-15/+24
| | | | all the same within the #ifdef WITH_PYMALLOC block.
* Remove PyMalloc_* symbols. PyObject_Malloc now uses pymalloc ifNeil Schemenauer2002-04-121-38/+44
| | | | | | | | | | it's enabled. Allow PyObject_Del, PyObject_Free, and PyObject_GC_Del to be used as function designators. Provide source compatibility macros. Make PyObject_GC_Track and PyObject_GC_UnTrack functions instead of trivial macros wrapping functions.
* Add _Py_AS_GC macro. It will be used by the trashcan code on object.c.Neil Schemenauer2002-03-281-2/+4
|
* Make PyObject_{NEW,New,Del,DEL} always use the standard malloc (PyMem_*)Neil Schemenauer2002-03-221-8/+23
| | | | | | and not pymalloc. Add the functions PyMalloc_New, PyMalloc_NewVar, and PyMalloc_Del that will use pymalloc if it's enabled. If pymalloc is not enabled then they use the standard malloc (PyMem_*).
* Drop the PyCore_* memory API.Neil Schemenauer2002-03-181-45/+8
|
* Simpilify PyCore_* macros by assuming the function prototypes forNeil Schemenauer2002-03-181-29/+9
| | | | malloc() and free() don't change.
* PyGC_Head: Use "long double" instead of "double" as the worst-caseTim Peters2002-02-281-1/+1
| | | | | | | alignment gimmick. David Abrahams notes that the standard "long double" actually requires stricter alignment than "double" on some Tru64 box. On my box and yours <wink>, it's the same, so no harm done on most boxes.
* SF bug [#467145] Python 2.2a4 build problem on HPUX 11.0.Tim Peters2001-10-111-12/+15
| | | | | | | | | | | | | | The platform requires 8-byte alignment for doubles, but the GC header was 12 bytes and that threw off the natural alignment of the double members of a subtype of complex. The fix puts the GC header into a union with a double as the other member, to force no-looser-than double alignment of GC headers. On boxes that require 8-byte alignment for doubles, this may add pad bytes to the GC header accordingly; ditto for platforms that *prefer* 8-byte alignment for doubles. On platforms that don't care, it shouldn't change the memory layout (because the size of the old GC header is certainly greater than the size of a double on all platforms, so unioning with a double shouldn't change size or alignment on such boxes).
* Guido suggests, and I agree, to insist that SIZEOF_VOID_P be a power of 2.Tim Peters2001-10-071-28/+24
| | | | | | This simplifies the rounding in _PyObject_VAR_SIZE, allows to restore the pre-rounding calling sequence, and allows some nice little simplifications in its callers. I'm still making it return a size_t, though.
* _PyObject_VAR_SIZE: always round up to a multiple-of-pointer-size value.Tim Peters2001-10-061-11/+35
| | | | | | | | | | | | | | | | | As Guido suggested, this makes the new subclassing code substantially simpler. But the mechanics of doing it w/ C macro semantics are a mess, and _PyObject_VAR_SIZE has a new calling sequence now. Question: The PyObject_NEW_VAR macro appears to be part of the public API. Regardless of what it expands to, the notion that it has to round up the memory it allocates is new, and extensions containing the old PyObject_NEW_VAR macro expansion (which was embedded in the PyObject_NEW_VAR expansion) won't do this rounding. But the rounding isn't actually *needed* except for new-style instances with dict pointers after a variable-length blob of embedded data. So my guess is that we do not need to bump the API version for this (as the rounding isn't needed for anything an extension can do unless it's recompiled anyway). What's your guess?
* Repaired the debug Windows deaths in test_descr, by allocating enoughTim Peters2001-10-061-1/+2
| | | | | | | | | | | | | | pad memory to properly align the __dict__ pointer in all cases. gcmodule.c/objimpl.h, _PyObject_GC_Malloc: + Added a "padding" argument so that this flavor of malloc can allocate enough bytes for alignment padding (it can't know this is needed, but its callers do). typeobject.c, PyType_GenericAlloc: + Allocated enough bytes to align the __dict__ pointer. + Sped and simplified the round-up-to-PTRSIZE logic. + Added blank lines so I could parse the if/else blocks <0.7 wink>.
* Add Garbage Collection support to new-style classes (not yet to theirGuido van Rossum2001-10-021-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | instances). Also added GC support to various auxiliary types: super, property, descriptors, wrappers, dictproxy. (Only type objects have a tp_clear field; the other types are.) One change was necessary to the GC infrastructure. We have statically allocated type objects that don't have a GC header (and can't easily be given one) and heap-allocated type objects that do have a GC header. Giving these different metatypes would be really ugly: I tried, and I had to modify pickle.py, cPickle.c, copy.py, add a new invent a new name for the new metatype and make it a built-in, change affected tests... In short, a mess. So instead, we add a new type slot tp_is_gc, which is a simple Boolean function that determines whether a particular instance has GC headers or not. This slot is only relevant for types that have the (new) GC flag bit set. If the tp_is_gc slot is NULL (by far the most common case), all instances of the type are deemed to have GC headers. This slot is called by the PyObject_IS_GC() macro (which is only used twice, both times in gcmodule.c). I also changed the extern declarations for a bunch of GC-related functions (_PyObject_GC_Del etc.): these always exist but objimpl.h only declared them when WITH_CYCLE_GC was defined, but I needed to be able to reference them without #ifdefs. (When WITH_CYCLE_GC is not defined, they do the same as their non-GC counterparts anyway.)
* Fix the names of _PyObject_GC_TRACK and _PyObject_GC_UNTRACK when the GC isNeil Schemenauer2001-09-031-2/+2
| | | | disabled. Obviously everyone enables the GC. :-)
* Change the GC type flag since the API has changed. Allow types usingNeil Schemenauer2001-08-291-50/+66
| | | | | | | the old flag to still compile. Remove the PyType_BASICSIZE and PyType_SET_BASICSIZE macros. Add PyObject_GC_New, PyObject_GC_NewVar, PyObject_GC_Resize, PyObject_GC_Del, PyObject_GC_Track, PyObject_GC_UnTrack. Part of SF patch #421893.
* Removed duplicate definnitions of PyObject_AS_GC and PyObject_FROM_GC ↵Jack Jansen2001-08-031-2/+0
| | | | (occurred only if GC was off).
* Merge of descr-branch back into trunk.Tim Peters2001-08-021-1/+14
|
* A small change to the C API for weakly-referencable types: Such typesFred Drake2001-03-221-5/+1
| | | | | | | | must now initialize the extra field used by the weak-ref machinery to NULL themselves, to avoid having to require PyObject_INIT() to check if the type supports weak references and do it there. This causes less work to be done for all objects (the type object does not need to be consulted to check for the Py_TPFLAGS_HAVE_WEAKREFS bit).
* Add Vladimir Marangozov's object allocator. It is disabled by default. ThisNeil Schemenauer2001-02-271-0/+7
| | | | closes SF patch #401229.
* Use a type flag to determine the applicability of the tp_weaklistoffsetFred Drake2001-02-021-1/+3
| | | | | field. This should avoid binary incompatibility problems with older modules that have not been recompiled.
* PEP 205, Weak References -- initial checkin.Fred Drake2001-02-011-1/+11
|
* PyGC_Dump() -> _PyGC_Dump()Barry Warsaw2001-01-241-1/+1
|
* Add prototype for PyGC_Dump() -- but only inside the #ifdefBarry Warsaw2001-01-231-0/+2
| | | | WITH_CYCLE_GC.
* Fix comment.Neil Schemenauer2001-01-201-2/+2
|
* REMOVED all CWI, CNRI and BeOpen copyright markings.Guido van Rossum2000-09-011-9/+0
| | | | This should match the situation in the 1.6b1 tree.
* Updated commentAndrew M. Kuchling2000-08-161-1/+1
|
* patch from Vladimir (move Py_Mem* interface to Include/pymem.h)Peter Schneider-Kamp2000-07-311-2/+3
|
* merge Include/my*.h into Include/pyport.hPeter Schneider-Kamp2000-07-311-1/+1
| | | | marked my*.h as obsolete
* Use 'void' directly instead of the ANY #define, now that all code is ANSI C.Thomas Wouters2000-07-251-7/+7
| | | | Leave the actual #define in for API compatibility.
* A small comment fix just to make sure I got my cvs/ssh setup right.Vladimir Marangozov2000-07-101-1/+1
|
* ANSI-fication and Py_PROTO extermination.Fred Drake2000-07-091-16/+17
|
* Neil Schemenauer: small fixes for GCGuido van Rossum2000-07-011-6/+3
|
* Change copyright notice - 2nd try.Guido van Rossum2000-06-301-6/+0
|
* Change copyright notice.Guido van Rossum2000-06-301-22/+7
|
* final patches from Neil Schemenauer for garbage collectionJeremy Hylton2000-06-301-3/+58
|
* part 2 of Neil Schemenauer's GC patches:Jeremy Hylton2000-06-231-0/+6
| | | | | | | | This patch modifies the type structures of objects that participate in GC. The object's tp_basicsize is increased when GC is enabled. GC information is prefixed to the object to maintain binary compatibility. GC objects also define the tp_flag Py_TPFLAGS_GC.
* Vladimir Marangozov's long-awaited malloc restructuring.Guido van Rossum2000-05-031-25/+187
| | | | | | | | | | For more comments, read the patches@python.org archives. For documentation read the comments in mymalloc.h and objimpl.h. (This is not exactly what Vladimir posted to the patches list; I've made a few changes, and Vladimir sent me a fix in private email for a problem that only occurs in debug mode. I'm also holding back on his change to main.c, which seems unnecessary to me.)