Skip to content

Commit ca8e49a

Browse files
committed
Move unicode_kind_name(); needed on release build
1 parent 5177d1c commit ca8e49a

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

Objects/unicode/methods.c

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,29 +1148,6 @@ PyUnicode_RPartition(PyObject *str_obj, PyObject *sep_obj)
11481148
}
11491149

11501150

1151-
#ifdef Py_DEBUG
1152-
/* Functions wrapping macros for use in debugger */
1153-
const char *_PyUnicode_utf8(void *unicode_raw){
1154-
PyObject *unicode = _PyObject_CAST(unicode_raw);
1155-
return PyUnicode_UTF8(unicode);
1156-
}
1157-
1158-
const void *_PyUnicode_compact_data(void *unicode_raw) {
1159-
PyObject *unicode = _PyObject_CAST(unicode_raw);
1160-
return _PyUnicode_COMPACT_DATA(unicode);
1161-
}
1162-
const void *_PyUnicode_data(void *unicode_raw) {
1163-
PyObject *unicode = _PyObject_CAST(unicode_raw);
1164-
printf("obj %p\n", (void*)unicode);
1165-
printf("compact %d\n", PyUnicode_IS_COMPACT(unicode));
1166-
printf("compact ascii %d\n", PyUnicode_IS_COMPACT_ASCII(unicode));
1167-
printf("ascii op %p\n", (void*)(_PyASCIIObject_CAST(unicode) + 1));
1168-
printf("compact op %p\n", (void*)(_PyCompactUnicodeObject_CAST(unicode) + 1));
1169-
printf("compact data %p\n", _PyUnicode_COMPACT_DATA(unicode));
1170-
return PyUnicode_DATA(unicode);
1171-
}
1172-
1173-
11741151
static const char*
11751152
unicode_kind_name(PyObject *unicode)
11761153
{
@@ -1209,6 +1186,29 @@ unicode_kind_name(PyObject *unicode)
12091186
}
12101187

12111188

1189+
#ifdef Py_DEBUG
1190+
/* Functions wrapping macros for use in debugger */
1191+
const char *_PyUnicode_utf8(void *unicode_raw){
1192+
PyObject *unicode = _PyObject_CAST(unicode_raw);
1193+
return PyUnicode_UTF8(unicode);
1194+
}
1195+
1196+
const void *_PyUnicode_compact_data(void *unicode_raw) {
1197+
PyObject *unicode = _PyObject_CAST(unicode_raw);
1198+
return _PyUnicode_COMPACT_DATA(unicode);
1199+
}
1200+
const void *_PyUnicode_data(void *unicode_raw) {
1201+
PyObject *unicode = _PyObject_CAST(unicode_raw);
1202+
printf("obj %p\n", (void*)unicode);
1203+
printf("compact %d\n", PyUnicode_IS_COMPACT(unicode));
1204+
printf("compact ascii %d\n", PyUnicode_IS_COMPACT_ASCII(unicode));
1205+
printf("ascii op %p\n", (void*)(_PyASCIIObject_CAST(unicode) + 1));
1206+
printf("compact op %p\n", (void*)(_PyCompactUnicodeObject_CAST(unicode) + 1));
1207+
printf("compact data %p\n", _PyUnicode_COMPACT_DATA(unicode));
1208+
return PyUnicode_DATA(unicode);
1209+
}
1210+
1211+
12121212
void
12131213
_PyUnicode_Dump(PyObject *op)
12141214
{

0 commit comments

Comments
 (0)