Repository navigation
Conversation
In debug mode, use a tagged pointer for PyListBuilder* to make sure that the pointer cannot be passed to an arbitrary Python C API function. Change list_new_prealloc() return type from PyObject* to PyListObject*.
|
@serhiy-storchaka @encukou: Do you think that such safety change would be useful in release mode as well? Or should it be restricted to the debug mode to avoid any performance overhead? I expected |
|
@ngoldbaum: I'm also curious about your opinion on using tagged pointers in release mode to detect API misuse. |
|
I'm a bit afraid that this'll make debugging harder, but, I won't block this. |
|
I'm no longer sure that this change is worth it. It causes practical issues. I prefer to close this PR. I just added
Oh right, that can be annoying when debugging bugs in C extensions. |
In debug mode, use a tagged pointer for PyListBuilder* to make sure that the pointer cannot be passed to an arbitrary Python C API function.
Change list_new_prealloc() return type from PyObject* to PyListObject*.
PyListBuilderC API to solvePyList_SetItem()performance issue on the free-threaded build #158660