resize_copy() now supports legacy ready strings

This commit is contained in:
Victor Stinner 2011-12-12 00:13:42 +01:00
parent 488fa49acf
commit 7a9105a380
2 changed files with 19 additions and 13 deletions

View file

@ -220,6 +220,7 @@ typedef struct {
- compact ascii:
* structure = PyASCIIObject
* test: PyUnicode_IS_COMPACT_ASCII(op)
* kind = PyUnicode_1BYTE_KIND
* compact = 1
* ascii = 1
@ -231,6 +232,7 @@ typedef struct {
- compact:
* structure = PyCompactUnicodeObject
* test: PyUnicode_IS_ASCII(op) && !PyUnicode_IS_COMPACT(op)
* kind = PyUnicode_1BYTE_KIND, PyUnicode_2BYTE_KIND or
PyUnicode_4BYTE_KIND
* compact = 1
@ -247,6 +249,7 @@ typedef struct {
- legacy string, not ready:
* structure = PyUnicodeObject
* test: kind == PyUnicode_WCHAR_KIND
* length = 0 (use wstr_length)
* hash = -1
* kind = PyUnicode_WCHAR_KIND
@ -262,6 +265,7 @@ typedef struct {
- legacy string, ready:
* structure = PyUnicodeObject structure
* test: !PyUnicode_IS_COMPACT(op) && kind != PyUnicode_WCHAR_KIND
* kind = PyUnicode_1BYTE_KIND, PyUnicode_2BYTE_KIND or
PyUnicode_4BYTE_KIND
* compact = 0