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.)
diff --git a/Modules/bsddbmodule.c b/Modules/bsddbmodule.c
index 16178ed..97a8e8b 100644
--- a/Modules/bsddbmodule.c
+++ b/Modules/bsddbmodule.c
@@ -89,7 +89,7 @@
 	bsddbobject *dp;
 	HASHINFO info;
 
-	if ((dp = PyObject_NEW(bsddbobject, &Bsddbtype)) == NULL)
+	if ((dp = PyObject_New(bsddbobject, &Bsddbtype)) == NULL)
 		return NULL;
 
 	info.bsize = bsize;
@@ -143,7 +143,7 @@
 	bsddbobject *dp;
 	BTREEINFO info;
 
-	if ((dp = PyObject_NEW(bsddbobject, &Bsddbtype)) == NULL)
+	if ((dp = PyObject_New(bsddbobject, &Bsddbtype)) == NULL)
 		return NULL;
 
 	info.flags = btflags;
@@ -200,7 +200,7 @@
 	bsddbobject *dp;
 	RECNOINFO info;
 
-	if ((dp = PyObject_NEW(bsddbobject, &Bsddbtype)) == NULL)
+	if ((dp = PyObject_New(bsddbobject, &Bsddbtype)) == NULL)
 		return NULL;
 
 	info.flags = rnflags;
@@ -261,7 +261,7 @@
 				"Python bsddb: close errno %d in dealloc\n",
 				errno);
 	}
-	PyMem_DEL(dp);
+	PyObject_Del(dp);
 }
 
 #ifdef WITH_THREAD