diff options
author | Guido van Rossum <guido@python.org> | 2000-05-03 23:44:39 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2000-05-03 23:44:39 (GMT) |
commit | b18618dab7b6b85bb05b084693706e59211fa180 (patch) | |
tree | 785d51f6677da8366be2ad4b4296a62f53161276 /Objects/classobject.c | |
parent | 2808b744e8d94459f189e1d89c97072d6a1f53b6 (diff) | |
download | cpython-b18618dab7b6b85bb05b084693706e59211fa180.zip cpython-b18618dab7b6b85bb05b084693706e59211fa180.tar.gz cpython-b18618dab7b6b85bb05b084693706e59211fa180.tar.bz2 |
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.)
Diffstat (limited to 'Objects/classobject.c')
-rw-r--r-- | Objects/classobject.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/Objects/classobject.c b/Objects/classobject.c index 6c7dba5..bd95bc0 100644 --- a/Objects/classobject.c +++ b/Objects/classobject.c @@ -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); } } |