summaryrefslogtreecommitdiffstats
path: root/Objects/object.c
Commit message (Collapse)AuthorAgeFilesLines
* the PyDict_SetItem does not borrow a reference, so we need to decrefJeremy Hylton2000-06-091-0/+1
| | | | reported by Mark Hammon
* Vladimir Marangozov's long-awaited malloc restructuring.Guido van Rossum2000-05-031-64/+60
| | | | | | | | | | 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.)
* Christian Tismer -- total rewrite on trashcan code.Guido van Rossum2000-04-241-15/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Improvements: - does no longer need any extra memory - has no relationship to tstate - works in debug mode - can easily be modified for free threading (hi Greg:) Side effects: Trashcan does change the order of object destruction. Prevending that would be quite an immense effort, as my attempts have shown. This version works always the same, with debug mode or not. The slightly changed destruction order should therefore be no problem. Algorithm: While the old idea of delaying the destruction of some obejcts at a certain recursion level was kept, we now no longer aloocate an object to hold these objects. The delayed objects are instead chained together via their ob_type field. The type is encoded via ob_refcnt. When it comes to the destruction of the chain of waiting objects, the topmost object is popped off the chain and revived with type and refcount 1, then it gets a normal Py_DECREF. I am confident that this solution is near optimum for minimizing side effects and code bloat.
* Fix PR#7 comparisons of recursive objectsJeremy Hylton2000-04-141-3/+112
| | | | | Note that comparisons of deeply nested objects can still dump core in extreme cases.
* Marc-Andre Lemburg:Guido van Rossum2000-04-101-2/+15
| | | | | | * TypeErrors during comparing of mixed type arguments including a Unicode object are now masked (just like they are for all other combinations).
* Skip Montanaro: add string precisions to calls to PyErr_FormatGuido van Rossum2000-04-101-2/+2
| | | | to prevent possible buffer overruns.
* Christian Tismer:Guido van Rossum2000-03-251-2/+8
| | | | | | Added "better safe than sorry" patch to the new trashcan code in object.c, to ensure that tstate is not touched when it might be undefined.
* Christian Tismer's "trashcan" patch:Guido van Rossum2000-03-131-0/+45
| | | | | | | | Added wrapping macros to dictobject.c, listobject.c, tupleobject.c, frameobject.c, traceback.c that safely prevends core dumps on stack overflow. Macros and functions in object.c, object.h. The method is an "elevator destructor" that turns cascading deletes into tail recursive behavior when some limit is hit.
* Many changes for Unicode, by Marc-Andre Lemburg.Guido van Rossum2000-03-101-11/+30
|
* The rest of the changes by Trent Mick and Dale Nagata for warning-freeGuido van Rossum2000-01-201-2/+4
| | | | compilation on NT Alpha. Mostly added casts etc.
* On Linux, one sometimes sees spurious errors after interruptingGuido van Rossum2000-01-121-0/+1
| | | | | previous output. Call clearerr() to prevent past errors affecting our ferror() test later, in PyObject_Print(). Suggested by Marc Lemburg.
* When comparing objects, always check that tp_compare is not NULLGuido van Rossum1998-07-211-3/+7
| | | | | | before calling it. This check was there when the objects were of the same type *before* coercion, but not if they initially differed but became the same *after* coercion.
* When comparing objects of different types (which is done by comparingGuido van Rossum1998-06-091-8/+15
| | | | | the type names), make sure that numeric objects are considered smaller than all other objects, by forcing their name to "".
* In PyObject_IsTrue(), don't call function pointers that are NULLGuido van Rossum1998-05-221-3/+6
| | | | (nb_nonzero, mp_length, sq_length).
* If USE_STACKCHECK is defined use PyOS_CheckStack() in the repr and strGuido van Rossum1998-04-281-0/+12
| | | | | | routines. This catches a slightly different set of crashes than the recursive-repr fix. (Jack)
* Be less naive about null characters in an object's repr().Guido van Rossum1998-04-211-2/+2
|
* Some robustness checks in Py_ReprLeave() in the unlikely event someoneGuido van Rossum1998-04-111-0/+4
| | | | has messed with the dictionary or list.
* Add implementations of Py_Repr{Enter,Leave}.Guido van Rossum1998-04-101-0/+64
| | | | (Jeremy will hardly recognize his patch :-)
* Add PyObject_Not().Guido van Rossum1998-04-091-0/+14
|
* Instead of "attribute-less object", issue an error message thatGuido van Rossum1998-01-191-1/+4
| | | | contains the type of the object and name of the attribute.
* Add a new function PyNumber_CoerceEx() which works just likeGuido van Rossum1997-11-191-3/+15
| | | | | | | | | | | | | | | | | PyNumber_Coerce() except that when the coercion can't be done and no other exceptions happen, it returns 1 instead of raising an exception. Use this function in PyObject_Compare() to avoid raising an exception simply because two objects with numeric behavior can't be coerced to a common type; instead, proceed with the non-numeric default comparison. Note that this is a somewhat questionable practice -- comparisons for numeric objects shouldn't default to random behavior like this, but it is required for backward compatibility. (Case in point, it broke comparison of kjDict objects to integers in Aaron Watters' kjbuckets extension.) A correct fix (for python 2.0) should involve a different definiton of comparison altogether.
* Fix mixup about PyErr_NoMemory() prototype.Guido van Rossum1997-08-121-4/+8
|
* Added _Py_ResetReferences(), if tracing references.Guido van Rossum1997-08-051-3/+84
| | | | | | | In _Py_PrintReferences(), no longer suppress once-referenced string. Add Py_Malloc and friends and PyMem_Malloc and friends (malloc wrappers for third parties).
* PyObject_Compare can raise an exception now.Guido van Rossum1997-05-231-15/+16
|
* Moved PyObject_{Get,Set}Attr here (from dictobject) and add PyObject_HasAttr.Guido van Rossum1997-05-201-0/+43
|
* Oops, another forgotten renaming: varobject -> PyVarObject.Guido van Rossum1997-05-151-5/+5
|
* Quickly renamed the last directory.Guido van Rossum1997-05-021-144/+145
|
* Intern the strings created in getattr() and setattr().Guido van Rossum1997-01-181-2/+2
|
* Make gcc -Wall happyGuido van Rossum1996-12-051-2/+2
|
* New permission notice, includes CNRI.Guido van Rossum1996-10-251-13/+20
|
* Correct typo in setattr: return -1 for error, not NULLGuido van Rossum1996-09-111-1/+1
|
* Define reference count admin debug functions to return void.Guido van Rossum1996-08-121-0/+4
|
* Support for tp_getattro, tp_setattro (Sjoerd)Guido van Rossum1996-08-091-0/+21
|
* Hacks for MS_COREDLLGuido van Rossum1996-07-211-0/+19
|
* rename printrefs, getobjects to _Py_ prefixGuido van Rossum1996-05-241-2/+2
|
* TRACE_REFS -> Py_TRACE_REFS.Guido van Rossum1996-05-221-1/+5
| | | | Added disgusting hack to force loading of abstract.o.
* Hack to force loading of cobject.oGuido van Rossum1996-01-121-0/+4
|
* Implemented two new functions in sys:Sjoerd Mullender1995-08-291-0/+58
| | | | | | | | | | | | getcounts() returns a list of counts of allocations and deallocations for all different object types. getobjects(n [, type ]) returns a list of recently allocated and not-yet-freed objects of the given type (all objects if no type given). Only the n most recent (all if n==0) objects are returned. getcounts is only available if compiled with -DCOUNT_ALLOCS, getobjects is only available if compiled with -DTRACE_REFS. Note that everything must be compiled with these options!
* args to call_object must be tuple or NULLGuido van Rossum1995-07-121-10/+4
|
* change in counting freed objectsGuido van Rossum1995-04-061-4/+4
|
* fix dusty debugging macrosGuido van Rossum1995-03-291-1/+1
|
* make size arg signedGuido van Rossum1995-02-101-1/+1
|
* move callable() hereGuido van Rossum1995-01-261-0/+29
|
* fix strobject() behaviorGuido van Rossum1995-01-171-2/+4
|
* properly implement cmp() for class instancesGuido van Rossum1995-01-121-0/+31
|
* move coerce() from bltinmodule.c to object.c and implement builtin_coerce() ↵Guido van Rossum1995-01-101-0/+33
| | | | differently
* attribute-less object is AttributeError, not TypeErrorGuido van Rossum1995-01-071-1/+1
|
* Added 1995 to copyright message.Guido van Rossum1995-01-041-2/+2
| | | | | floatobject.c: fix hash(). methodobject.c: support METH_FREENAME flag bit.
* Lots of minor changes. Note for mappingobject.c: the hash table pointerGuido van Rossum1995-01-021-13/+7
| | | | can now be NULL.
* rearranged code in debugging version of DELREF to avoid touching dataGuido van Rossum1994-09-071-1/+2
| | | | after it has been freed.