[WIP] bpo-35265: Add _PyConfigCtx#10574
Closed
vstinner wants to merge 12 commits intopython:masterfrom
vstinner:ctx
Closed
[WIP] bpo-35265: Add _PyConfigCtx#10574vstinner wants to merge 12 commits intopython:masterfrom vstinner:ctx
vstinner wants to merge 12 commits intopython:masterfrom
vstinner:ctx
Conversation
* Add _PyConfigCtx structure * Add "ctx" context (_PyConfigCtx) to _PyCoreConfig, _PyPathConfig, _Py_PreInit and PyCalculatePath. * Move _PyCoreConfig.utf8_mode into _PyConfigCtx * Replace _PyCoreConfig_INIT with _PyCoreConfig_Init() * Replace _PyPathConfig_INIT with _PyPathConfig_StaticInit() * Add new functions: * _PyMem_RawMallocCtx() * _PyMem_RawCallocCtx() * _PyMem_RawReallocCtx() * _PyMem_RawFreeCtx() * Add ctx paramter to functions: * _Py_DecodeLocaleEx() * _Py_EncodeLocaleEx() * _PyMem_RawWcsdup() * Use ctx in Python initialization code
Member
Author
|
"./python -m test -v test_cmd_line -m test_pythonmalloc" fails. There is very likely bugs somewhere in my change, but I mostly wrote this PR as proof-of-concept. It's not ready to be reviewed nor to be merged. |
Fix "initializer is not a constant" error.
Member
Author
|
Honestly, I'm not convinced that the change is worth it. It looks like a giant complication for a very specific use case, whereas the current _PyMem_SetDefaultAllocator() solution "works". I close the PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add _PyConfigCtx structure
Add "ctx" context (_PyConfigCtx) to _PyCoreConfig, _PyPathConfig,
_Py_PreInit and PyCalculatePath.
Move _PyCoreConfig.utf8_mode into _PyConfigCtx
Replace _PyCoreConfig_INIT with _PyCoreConfig_Init()
Replace _PyPathConfig_INIT with _PyPathConfig_StaticInit()
Add new functions:
Add ctx paramter to functions:
Use ctx in Python initialization code
https://bugs.python.org/issue35265