Skip to content
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

bpo-32096: Remove obj and mem from _PyRuntime #4532

Merged
merged 7 commits into from
Nov 24, 2017
Merged

bpo-32096: Remove obj and mem from _PyRuntime #4532

merged 7 commits into from
Nov 24, 2017

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Nov 23, 2017

bpo-32096, bpo-30860: Partially revert the commit
2ebc5ce:

  • Move structures back from Include/internal/mem.h to
    Objects/obmalloc.c
  • Remove _PyObject_Initialize() and _PyMem_Initialize()
  • Remove Include/internal/pymalloc.h

PyMem_RawMalloc() and Py_DecodeLocale() can be called again before
_PyRuntimeState_Init().

https://bugs.python.org/issue32096

bpo-32096, bpo-30860:  Partially revert the commit
2ebc5ce:

* Move structures back from Include/internal/mem.h to
  Objects/obmalloc.c
* Remove _PyObject_Initialize() and _PyMem_Initialize()
* Remove Include/internal/pymalloc.h

PyMem_RawMalloc() and Py_DecodeLocale() can be called again before
_PyRuntimeState_Init().
Copy link
Contributor

@ncoghlan ncoghlan left a comment

Choose a reason for hiding this comment

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

While I'm +1 for this reversion, it should have a NEWS entry, since it's reverting changes that were published in previous alpha releases.

It should also incorporate @ericsnowcurrently's new test case from https://github.com/python/cpython/pull/4495/files#diff-559231a69a7d7f06ab48269b3bfa1f45, to confirm that it actually is fixing the regression it's intended to fix.

@bedevere-bot
Copy link

When you're done making the requested changes, leave the comment: I have made the requested changes; please review again.

vstinner and others added 3 commits November 24, 2017 01:08
Make sure that it's possible to call Py_DecodeLocale(), and then call
Py_SetProgramName() with the decoded string, before Py_Initialize().

Co-Authored-By: Eric Snow <ericsnowcurrently@gmail.com>
@vstinner vstinner dismissed ncoghlan’s stale review November 24, 2017 00:19

I added the NEWS entry and copied Eric's unit test

@@ -0,0 +1,4 @@
Revert memory allocator changes in the C API: move structures back from
_PyRuntime to Objects/obmalloc.c. The memory allocators are now initialized
again statically, and so PyMem_RawMalloc() and Py_DecodeLocale() can be
Copy link
Contributor

Choose a reason for hiding this comment

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

Slight grammar tweak: "now initialized again" -> "once again initialized"

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed

Copy link
Contributor

@ncoghlan ncoghlan left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

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.

5 participants