[issue35265] Internal C API: pass the memory allocator in a context

2018-11-22 Thread STINNER Victor
Change by STINNER Victor : -- resolution: -> rejected stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue35265] Internal C API: pass the memory allocator in a context

2018-11-22 Thread STINNER Victor
STINNER Victor added the comment: 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 issue. Moreover, bpo-35266 conflicts with issue, and

[issue35265] Internal C API: pass the memory allocator in a context

2018-11-18 Thread Nick Coghlan
Nick Coghlan added the comment: I think the idea makes sense, but find the proposed name potentially confusing for two reasons: 1. It isn't only about configuration, it's about interpreter initialisation state in general 2. We use "context" for several other purposes already (most notably

[issue35265] Internal C API: pass the memory allocator in a context

2018-11-16 Thread STINNER Victor
STINNER Victor added the comment: Passing the memory allocator is my first goal. My second goal is to cleanup the code reading the configuration, pymain_read_conf() in Modules/main.c: int utf8_mode = config->ctx.utf8_mode; int encoding_changed = 0; (...) /*

[issue35265] Internal C API: pass the memory allocator in a context

2018-11-16 Thread STINNER Victor
Change by STINNER Victor : -- keywords: +patch pull_requests: +9822 stage: -> patch review ___ Python tracker ___ ___

[issue35265] Internal C API: pass the memory allocator in a context

2018-11-16 Thread STINNER Victor
New submission from STINNER Victor : Currently, the Python initialization code base is full of: static void pymain_clear_cmdline(_PyMain *pymain, _PyCmdline *cmdline) { PyMemAllocatorEx old_alloc; _PyMem_SetDefaultAllocator(PYMEM_DOMAIN_RAW, _alloc); ...