You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Wrap unused arguments in Objects/obmalloc.c with Py_UNUSED. #93040
You'll find there's a lot of unused arguments in the CPython code base. We could wrap these two in Py_UNUSED, but there would be a lot left, so I don't see a particular reason to just change these two.
changed the title [-]Parameter ctx is not used in function pymalloc_alloc and pymalloc_free[/-][+]Wrap unused arguments in Objects/obmalloc.c with `Py_UNUSED`.[/+]on May 22, 2022
Activity
erlend-aasland commentedon May 22, 2022
You'll find there's a lot of unused arguments in the CPython code base. We could wrap these two in
Py_UNUSED, but there would be a lot left, so I don't see a particular reason to just change these two.Suggesting to close this.
erlend-aasland commentedon May 22, 2022
cc. @vstinner
erlend-aasland commentedon May 22, 2022
FTR:
cpython/Objects/obmalloc.c
Lines 1947 to 1948 in e5d8dbd
cpython/Objects/obmalloc.c
Lines 2217 to 2218 in e5d8dbd
erlend-aasland commentedon May 22, 2022
The following functions in obmalloc.c have one or more unused arguments:
_PyMem_RawMalloc_PyMem_RawCalloc_PyMem_RawRealloc_PyMem_RawFree_PyObject_ArenaVirtualAlloc_PyObject_ArenaVirtualFree_PyObject_ArenaMmap_PyObject_ArenaMunmap_PyObject_ArenaMalloc_PyObject_ArenaFreeaddress_in_rangepymalloc_allocpymalloc_freeVictor says he's +1 on wrapping unused arguments with
Py_UNUSED.[-]Parameter ctx is not used in function pymalloc_alloc and pymalloc_free[/-][+]Wrap unused arguments in Objects/obmalloc.c with `Py_UNUSED`.[/+]zikcheng commentedon May 23, 2022
Why wrapping instead of removing, is it a convention?
vstinner commentedon May 23, 2022
The ctx parameter is part of PEP 445 API.
gh-93040 Wrap unused parameters in Objects/obmalloc.c with Py_UNUSED (#…
kumaraditya303 commentedon May 25, 2022
Fixed by #93175