summaryrefslogtreecommitdiffstats
path: root/Objects/object.c
Commit message (Collapse)AuthorAgeFilesLines
...
* delete unused local variable from _PyTrash_deposit_objectSkip Montanaro2000-07-081-1/+0
|
* If auto-conversion fails, the Unicode codecs will return NULL.Marc-André Lemburg2000-07-031-11/+13
| | | | This is now checked and the error passed on to the caller.
* changed repr and str to always convert unicode stringsFredrik Lundh2000-07-011-0/+16
| | | | to 8-bit strings, using the default encoding.
* Neil Schemenauer: small fixes for GCGuido van Rossum2000-07-011-7/+4
|
* Change copyright notice - 2nd try.Guido van Rossum2000-06-301-6/+0
|
* Change copyright notice.Guido van Rossum2000-06-301-22/+7
|
* Trent Mick <trentm@activestate.com>:Fred Drake2000-06-301-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | The common technique for printing out a pointer has been to cast to a long and use the "%lx" printf modifier. This is incorrect on Win64 where casting to a long truncates the pointer. The "%p" formatter should be used instead. The problem as stated by Tim: > Unfortunately, the C committee refused to define what %p conversion "looks > like" -- they explicitly allowed it to be implementation-defined. Older > versions of Microsoft C even stuck a colon in the middle of the address (in > the days of segment+offset addressing)! The result is that the hex value of a pointer will maybe/maybe not have a 0x prepended to it. Notes on the patch: There are two main classes of changes: - in the various repr() functions that print out pointers - debugging printf's in the various thread_*.h files (these are why the patch is large) Closes SourceForge patch #100505.
* final patches from Neil Schemenauer for garbage collectionJeremy Hylton2000-06-301-1/+33
|
* This patch addresses two main issues: (1) There exist some non-fatalFred Drake2000-06-291-2/+61
| | | | | | | | | | | | | | | | | | | | errors in some of the hash algorithms. For exmaple, in float_hash and complex_hash a certain part of the value is not included in the hash calculation. See Tim's, Guido's, and my discussion of this on python-dev in May under the title "fix float_hash and complex_hash for 64-bit *nix" (2) The hash algorithms that use pointers (e.g. func_hash, code_hash) are universally not correct on Win64 (they assume that sizeof(long) == sizeof(void*)) As well, this patch significantly cleans up the hash code. It adds the two function _Py_HashDouble and _PyHash_VoidPtr that the various hashing routine are changed to use. These help maintain the hash function invariant: (a==b) => (hash(a)==hash(b))) I have added Lib/test/test_hash.py and Lib/test/output/test_hash to test this for some cases.
* Trent Mick: change a few casts for Win64 compatibility.Guido van Rossum2000-06-281-1/+1
|
* raise TypeError when PyObject_Get/SetAttr called with non-string nameJeremy Hylton2000-06-231-5/+17
|
* 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
|