Don't check for the maximum character when copying from unicodeobject.c

* Create copy_characters() function which doesn't check for the maximum
   character in release mode
 * _PyUnicode_CheckConsistency() is no more static to be able to use it
   in _PyUnicode_FormatAdvanced() (in formatter_unicode.c)
 * _PyUnicode_CheckConsistency() checks the string hash
This commit is contained in:
Victor Stinner 2011-10-06 01:45:57 +02:00
parent 05d1189566
commit fb9ea8c57e
3 changed files with 198 additions and 193 deletions

View file

@ -2030,6 +2030,13 @@ PyAPI_FUNC(Py_UNICODE*) PyUnicode_AsUnicodeCopy(
);
#endif /* Py_LIMITED_API */
#if defined(Py_DEBUG) && !defined(Py_LIMITED_API)
/* FIXME: use PyObject* type for op */
PyAPI_FUNC(int) _PyUnicode_CheckConsistency(
void *op,
int check_content);
#endif
#ifdef __cplusplus
}
#endif