mirror of
https://github.com/python/cpython.git
synced 2025-11-02 06:31:29 +00:00
gh-132775: Add _PyBytes_GetXIData() (gh-133101)
This is the base for several other XIData wrappers, like pickle and marshal. It is essentially a refactor of the existing bytes XIData code.
This commit is contained in:
parent
31d1342de9
commit
606003ffa9
3 changed files with 99 additions and 14 deletions
|
|
@ -154,7 +154,7 @@ _PyXIData_InitWithSize(_PyXIData_t *xidata,
|
|||
// where it was allocated, so the interpreter is required.
|
||||
assert(interp != NULL);
|
||||
_PyXIData_Init(xidata, interp, NULL, obj, new_object);
|
||||
xidata->data = PyMem_RawMalloc(size);
|
||||
xidata->data = PyMem_RawCalloc(1, size);
|
||||
if (xidata->data == NULL) {
|
||||
return -1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue