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
Moving _PyMem_RawStrdup to private API causes build failure #127991
@vstinner Do you think it's worth adding a public variation of PyMem_Strdup and PyMem_RawStrdup?
It's not worth it. Please don't add them.
There is a simple replacement for _PyMem_RawStrdup(): just use strdup() (with free()). If you really need/want to use PyMem_RawMalloc(), you can copy/paste the code that @tomasr8 gave.
@clin1234: Would you be ok to close the issue? Or do you think that something else should be done? I'm not sure why you closed your cx_Freeze upstream PR.
Activity
tomasr8 commentedon Dec 16, 2024
Made private here: #107187
I think as a replacement you can do what the function is doing internally, that is, call
PyMem_RawMallocandmemcpy:cpython/Objects/obmalloc.c
Lines 1047 to 1057 in 52d552c
ZeroIntensity commentedon Dec 16, 2024
@vstinner Do you think it's worth adding a public variation of
PyMem_StrdupandPyMem_RawStrdup?vstinner commentedon Dec 17, 2024
@ZeroIntensity:
It's not worth it. Please don't add them.
There is a simple replacement for
_PyMem_RawStrdup(): just usestrdup()(withfree()). If you really need/want to usePyMem_RawMalloc(), you can copy/paste the code that @tomasr8 gave.Replace _PyMem_RawStrdup with strdup
vstinner commentedon Dec 17, 2024
@clin1234: Would you be ok to close the issue? Or do you think that something else should be done? I'm not sure why you closed your cx_Freeze upstream PR.
clin1234 commentedon Dec 17, 2024
I made a separate pull request replacing the private function with strdup (marcelotduarte/cx_Freeze#2738)