summaryrefslogtreecommitdiffstats
path: root/Modules/cPickle.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2000-05-03 23:44:39 (GMT)
committerGuido van Rossum <guido@python.org>2000-05-03 23:44:39 (GMT)
commitb18618dab7b6b85bb05b084693706e59211fa180 (patch)
tree785d51f6677da8366be2ad4b4296a62f53161276 /Modules/cPickle.c
parent2808b744e8d94459f189e1d89c97072d6a1f53b6 (diff)
downloadcpython-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 'Modules/cPickle.c')
-rw-r--r--Modules/cPickle.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/Modules/cPickle.c b/Modules/cPickle.c
index aa2c7cb..73cb6ba 100644
--- a/Modules/cPickle.c
+++ b/Modules/cPickle.c
@@ -171,7 +171,7 @@ Pdata_dealloc(Pdata *self) {
if (self->data) free(self->data);
- PyMem_DEL(self);
+ PyObject_Del(self);
}
static PyTypeObject PdataType = {
@@ -186,7 +186,7 @@ static PyObject *
Pdata_New() {
Pdata *self;
- UNLESS (self = PyObject_NEW(Pdata, &PdataType)) return NULL;
+ UNLESS (self = PyObject_New(Pdata, &PdataType)) return NULL;
self->size=8;
self->length=0;
self->data=malloc(self->size * sizeof(PyObject*));
@@ -2132,7 +2132,7 @@ static Picklerobject *
newPicklerobject(PyObject *file, int bin) {
Picklerobject *self;
- UNLESS (self = PyObject_NEW(Picklerobject, &Picklertype))
+ UNLESS (self = PyObject_New(Picklerobject, &Picklertype))
return NULL;
self->fp = NULL;
@@ -2243,7 +2243,7 @@ Pickler_dealloc(Picklerobject *self) {
free(self->write_buf);
}
- PyMem_DEL(self);
+ PyObject_Del(self);
}
@@ -2885,7 +2885,7 @@ Instance_New(PyObject *cls, PyObject *args) {
PyInstanceObject *inst;
PyErr_Clear();
- UNLESS (inst=PyObject_NEW(PyInstanceObject, &PyInstance_Type))
+ UNLESS (inst=PyObject_New(PyInstanceObject, &PyInstance_Type))
goto err;
inst->in_class=(PyClassObject*)cls;
Py_INCREF(cls);
@@ -4036,7 +4036,7 @@ static Unpicklerobject *
newUnpicklerobject(PyObject *f) {
Unpicklerobject *self;
- UNLESS (self = PyObject_NEW(Unpicklerobject, &Unpicklertype))
+ UNLESS (self = PyObject_New(Unpicklerobject, &Unpicklertype))
return NULL;
self->file = NULL;
@@ -4141,7 +4141,7 @@ Unpickler_dealloc(Unpicklerobject *self) {
free(self->buf);
}
- PyMem_DEL(self);
+ PyObject_Del(self);
}