New submission from Serhiy Storchaka: Since Python 3.3 PyUnicode_AsUnicodeAndSize() is deprecated in favour of PyUnicode_AsWideChar() and PyUnicode_AsWideCharString(). But the latter two are implemented using PyUnicode_AsUnicodeAndSize(). This prevents adding the deprecation compiler warning for PyUnicode_AsUnicodeAndSize(). Other side effect -- PyUnicode_AsWideChar() and PyUnicode_AsWideCharString() cache the wchar_t* representation of the PyUnicode object increasing its memory consumption.
Proposed patch reimplements PyUnicode_AsWideChar(), PyUnicode_AsWideCharString() and PyUnicode_AsUnicodeAndSize() using two common helper functions. PyUnicode_AsWideChar() and PyUnicode_AsWideCharString() no longer cache the wchar_t* representation. ---------- components: Interpreter Core, Unicode messages: 297813 nosy: ezio.melotti, haypo, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Rewrite PyUnicode_AsWideChar() and PyUnicode_AsWideCharString() type: resource usage versions: Python 3.7 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30863> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com