Thanks to visit codestin.com
Credit goes to github.com

Skip to content

gh-93040 Wrap unused parameters in Objects/obmalloc.c with Py_UNUSED #93175

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from May 25, 2022
Merged

gh-93040 Wrap unused parameters in Objects/obmalloc.c with Py_UNUSED #93175

merged 2 commits into from May 25, 2022

Conversation

ghost
Copy link

@ghost ghost commented May 24, 2022

Issue #93040.

This PR wraps unused parameters with Py_UNUSED() in the following functions from obmalloc.c:

  • _PyMem_RawMalloc
  • _PyMem_RawCalloc
  • _PyMem_RawRealloc
  • _PyMem_RawFree
  • _PyObject_ArenaVirtualAlloc
  • _PyObject_ArenaVirtualFree
  • _PyObject_ArenaMmap
  • _PyObject_ArenaMunmap
  • _PyObject_ArenaMalloc
  • _PyObject_ArenaFree
  • address_in_range
  • pymalloc_alloc
  • pymalloc_free

address_in_range() is a special one out of this list as there are different versions of this function depending on the value of a macro. I have only added Py_UNUSED() for the version that does not use the pool parameter.

@ghost
Copy link
Author

ghost commented May 25, 2022

cc @erlend-aasland @vstinner for your involvement in the issue.

Copy link
Contributor

@erlend-aasland erlend-aasland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@vstinner
Copy link
Member

Merged, thanks. I don't think that this change should be backported, unless some C compilers emit many warnings when building Python 3.10 and 3.11.

@ghost ghost deleted the fix-issue-93040 branch May 25, 2022 12:48
@ghost
Copy link
Author

ghost commented May 25, 2022

Thanks @vstinner @erlend-aasland!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants