mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
Cleanup a bit and make things more consistent.
Don't double check for NULLs and don't initialize if not necessary. No functional changes.
This commit is contained in:
parent
b04747fc50
commit
84456bdab3
2 changed files with 87 additions and 142 deletions
|
|
@ -40,9 +40,6 @@ PyArenaList_New(void)
|
|||
static void
|
||||
PyArenaList_FreeObject(PyArenaList *alist)
|
||||
{
|
||||
if (!alist)
|
||||
return;
|
||||
|
||||
while (alist) {
|
||||
PyArenaList *prev;
|
||||
Py_XDECREF((PyObject *)alist->al_pointer);
|
||||
|
|
@ -56,9 +53,6 @@ PyArenaList_FreeObject(PyArenaList *alist)
|
|||
static void
|
||||
PyArenaList_FreeMalloc(PyArenaList *alist)
|
||||
{
|
||||
if (!alist)
|
||||
return;
|
||||
|
||||
while (alist) {
|
||||
PyArenaList *prev;
|
||||
if (alist->al_pointer) {
|
||||
|
|
@ -105,7 +99,8 @@ PyArena_Malloc(PyArena *arena, size_t size)
|
|||
void *p;
|
||||
assert(size != 0);
|
||||
p = malloc(size);
|
||||
PyArena_AddMallocPointer(arena, p);
|
||||
if (p)
|
||||
PyArena_AddMallocPointer(arena, p);
|
||||
return p;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue