| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
reported by Mark Hammon
|
|
|
|
|
|
|
|
|
|
| |
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.)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Note that comparisons of deeply nested objects can still dump core in
extreme cases.
|
|
|
|
|
|
| |
* TypeErrors during comparing of mixed type arguments including
a Unicode object are now masked (just like they are for all
other combinations).
|
|
|
|
| |
to prevent possible buffer overruns.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
compilation on NT Alpha. Mostly added casts etc.
|
|
|
|
|
| |
previous output. Call clearerr() to prevent past errors affecting our
ferror() test later, in PyObject_Print(). Suggested by Marc Lemburg.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
the type names), make sure that numeric objects are considered smaller
than all other objects, by forcing their name to "".
|
|
|
|
| |
(nb_nonzero, mp_length, sq_length).
|
|
|
|
|
|
| |
routines. This catches a slightly different set of crashes than the
recursive-repr fix.
(Jack)
|
| |
|
|
|
|
| |
has messed with the dictionary or list.
|
|
|
|
| |
(Jeremy will hardly recognize his patch :-)
|
| |
|
|
|
|
| |
contains the type of the object and name of the attribute.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
| |
In _Py_PrintReferences(), no longer suppress once-referenced string.
Add Py_Malloc and friends and PyMem_Malloc and friends (malloc
wrappers for third parties).
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Added disgusting hack to force loading of abstract.o.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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!
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
differently
|
| |
|
|
|
|
|
| |
floatobject.c: fix hash().
methodobject.c: support METH_FREENAME flag bit.
|
|
|
|
| |
can now be NULL.
|
|
|
|
| |
after it has been freed.
|