Replace PyMem_RawMalloc and PyMemRawFree with malloc and free,
reverting my adjustment in
3b98812aa98a1590e2bebbc83c113c07e4c002bc.
Python 2 doesn't support them, and at least right now, regardless of
what the current python docs suggest, at the moment, they're just
trivial wrappers around malloc and free.
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
// vint/vuint we can encode is anyway 10 bytes, so this gives us
// some headroom for a few strings before we need to realloc ...
bufsz = sz * 20;
- buf = PyMem_RawMalloc(bufsz);
+ buf = malloc(bufsz);
if (!buf)
return PyErr_NoMemory();
}
result = PyBytes_FromStringAndSize(buf, pos - buf);
- PyMem_RawFree(buf);
+ free(buf);
return result;
overflow:
PyErr_SetString(PyExc_OverflowError, "buffer (potentially) overflowed");
error:
- PyMem_RawFree(buf);
+ free(buf);
return NULL;
}