Issue #18874: _PyObject_Malloc/Realloc/Free() now falls back on
_PyMem_RawMalloc/Realloc/Free, instead of _PyMem_Malloc/Realloc/Free.  So it
becomes possible to use the fast pymalloc allocator for the PYMEM_DOMAIN_MEM
domain (PyMem_Malloc/Realloc/Free functions).
diff --git a/Objects/obmalloc.c b/Objects/obmalloc.c
index f7b3e49..004cfaa 100644
--- a/Objects/obmalloc.c
+++ b/Objects/obmalloc.c
@@ -125,10 +125,11 @@
 
 #define PYRAW_FUNCS _PyMem_RawMalloc, _PyMem_RawRealloc, _PyMem_RawFree
 #ifdef WITH_PYMALLOC
-#define PYOBJECT_FUNCS _PyObject_Malloc, _PyObject_Realloc, _PyObject_Free
+#  define PYOBJ_FUNCS _PyObject_Malloc, _PyObject_Realloc, _PyObject_Free
 #else
-#define PYOBJECT_FUNCS PYRAW_FUNCS
+#  define PYOBJ_FUNCS PYRAW_FUNCS
 #endif
+#define PYMEM_FUNCS PYRAW_FUNCS
 
 #ifdef PYMALLOC_DEBUG
 typedef struct {
@@ -142,16 +143,16 @@
     debug_alloc_api_t obj;
 } _PyMem_Debug = {
     {'r', {NULL, PYRAW_FUNCS}},
-    {'m', {NULL, PYRAW_FUNCS}},
-    {'o', {NULL, PYOBJECT_FUNCS}}
+    {'m', {NULL, PYMEM_FUNCS}},
+    {'o', {NULL, PYOBJ_FUNCS}}
     };
 
-#define PYDEBUG_FUNCS _PyMem_DebugMalloc, _PyMem_DebugRealloc, _PyMem_DebugFree
+#define PYDBG_FUNCS _PyMem_DebugMalloc, _PyMem_DebugRealloc, _PyMem_DebugFree
 #endif
 
 static PyMemAllocator _PyMem_Raw = {
 #ifdef PYMALLOC_DEBUG
-    &_PyMem_Debug.raw, PYDEBUG_FUNCS
+    &_PyMem_Debug.raw, PYDBG_FUNCS
 #else
     NULL, PYRAW_FUNCS
 #endif
@@ -159,23 +160,24 @@
 
 static PyMemAllocator _PyMem = {
 #ifdef PYMALLOC_DEBUG
-    &_PyMem_Debug.mem, PYDEBUG_FUNCS
+    &_PyMem_Debug.mem, PYDBG_FUNCS
 #else
-    NULL, PYRAW_FUNCS
+    NULL, PYMEM_FUNCS
 #endif
     };
 
 static PyMemAllocator _PyObject = {
 #ifdef PYMALLOC_DEBUG
-    &_PyMem_Debug.obj, PYDEBUG_FUNCS
+    &_PyMem_Debug.obj, PYDBG_FUNCS
 #else
-    NULL, PYOBJECT_FUNCS
+    NULL, PYOBJ_FUNCS
 #endif
     };
 
 #undef PYRAW_FUNCS
-#undef PYOBJECT_FUNCS
-#undef PYDEBUG_FUNCS
+#undef PYMEM_FUNCS
+#undef PYOBJ_FUNCS
+#undef PYDBG_FUNCS
 
 static PyObjectArenaAllocator _PyObject_Arena = {NULL,
 #ifdef MS_WINDOWS
@@ -924,7 +926,7 @@
             return NULL;                /* overflow */
 #endif
         nbytes = numarenas * sizeof(*arenas);
-        arenaobj = (struct arena_object *)PyMem_Realloc(arenas, nbytes);
+        arenaobj = (struct arena_object *)PyMem_RawRealloc(arenas, nbytes);
         if (arenaobj == NULL)
             return NULL;
         arenas = arenaobj;
@@ -1309,7 +1311,7 @@
      * has been reached.
      */
     {
-        void *result = PyMem_Malloc(nbytes);
+        void *result = PyMem_RawMalloc(nbytes);
         if (!result)
             _Py_AllocatedBlocks--;
         return result;
@@ -1539,7 +1541,7 @@
 redirect:
 #endif
     /* We didn't allocate this address. */
-    PyMem_Free(p);
+    PyMem_RawFree(p);
 }
 
 /* realloc.  If p is NULL, this acts like malloc(nbytes).  Else if nbytes==0,
@@ -1608,14 +1610,14 @@
      * at p.  Instead we punt:  let C continue to manage this block.
      */
     if (nbytes)
-        return PyMem_Realloc(p, nbytes);
+        return PyMem_RawRealloc(p, nbytes);
     /* C doesn't define the result of realloc(p, 0) (it may or may not
      * return NULL then), but Python's docs promise that nbytes==0 never
      * returns NULL.  We don't pass 0 to realloc(), to avoid that endcase
      * to begin with.  Even then, we can't be sure that realloc() won't
      * return NULL.
      */
-    bp = PyMem_Realloc(p, 1);
+    bp = PyMem_RawRealloc(p, 1);
     return bp ? bp : p;
 }