Vladimir Marangozov's long-awaited malloc restructuring.

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.)
This commit is contained in:
Guido van Rossum 2000-05-03 23:44:39 +00:00
parent 2808b744e8
commit b18618dab7
73 changed files with 658 additions and 407 deletions

View file

@ -147,7 +147,7 @@ class_dealloc(op)
Py_XDECREF(op->cl_getattr);
Py_XDECREF(op->cl_setattr);
Py_XDECREF(op->cl_delattr);
free((ANY *)op);
PyObject_DEL(op);
}
static PyObject *
@ -561,7 +561,7 @@ instance_dealloc(inst)
#endif /* Py_TRACE_REFS */
Py_DECREF(inst->in_class);
Py_XDECREF(inst->in_dict);
free((ANY *)inst);
PyObject_DEL(inst);
}
static PyObject *
@ -1498,8 +1498,7 @@ PyMethod_New(func, self, class)
im = free_list;
if (im != NULL) {
free_list = (PyMethodObject *)(im->im_self);
im->ob_type = &PyMethod_Type;
_Py_NewReference((PyObject *)im);
PyObject_INIT(im, &PyMethod_Type);
}
else {
im = PyObject_NEW(PyMethodObject, &PyMethod_Type);
@ -1691,8 +1690,8 @@ void
PyMethod_Fini()
{
while (free_list) {
PyMethodObject *v = free_list;
free_list = (PyMethodObject *)(v->im_self);
PyMem_DEL(v);
PyMethodObject *im = free_list;
free_list = (PyMethodObject *)(im->im_self);
PyObject_DEL(im);
}
}