Issue30863
Created on 2017-07-06 07:53 by serhiy.storchaka, last changed 2022-04-11 14:58 by admin. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 2599 | merged | serhiy.storchaka, 2017-07-06 07:56 | |
| Messages (5) | |||
|---|---|---|---|
| msg297813 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * | Date: 2017-07-06 07:53 | |
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. |
|||
| msg322252 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * | Date: 2018-07-23 20:10 | |
Victor already wrote similar patch in issue22323. |
|||
| msg322265 - (view) | Author: STINNER Victor (vstinner) * | Date: 2018-07-23 21:42 | |
Would it be possible to remove the wchar_t* cache? |
|||
| msg322268 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * | Date: 2018-07-23 22:00 | |
Only after removing PyUnicode_AsUnicodeAndSize() and related PyArg_ParseTuple codes. |
|||
| msg328340 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * | Date: 2018-10-23 19:58 | |
New changeset c46db9232f1a6e0e3c33053549d03d4335db9dca by Serhiy Storchaka in branch 'master': bpo-30863: Rewrite PyUnicode_AsWideChar() and PyUnicode_AsWideCharString(). (GH-2599) https://github.com/python/cpython/commit/c46db9232f1a6e0e3c33053549d03d4335db9dca |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:58:48 | admin | set | github: 75046 |
| 2018-10-23 20:03:17 | serhiy.storchaka | set | status: open -> closed stage: patch review -> resolved resolution: fixed versions: + Python 3.8, - Python 3.7 |
| 2018-10-23 19:58:28 | serhiy.storchaka | set | messages: + msg328340 |
| 2018-07-23 22:00:26 | serhiy.storchaka | set | messages: + msg322268 |
| 2018-07-23 21:42:08 | vstinner | set | messages: + msg322265 |
| 2018-07-23 20:11:11 | serhiy.storchaka | set | messages: - msg322251 |
| 2018-07-23 20:10:59 | serhiy.storchaka | set | messages: + msg322252 |
| 2018-07-23 20:09:11 | serhiy.storchaka | set | messages: + msg322251 |
| 2017-07-06 07:56:29 | serhiy.storchaka | set | pull_requests: + pull_request2667 |
| 2017-07-06 07:53:21 | serhiy.storchaka | create | |