mirror of https://github.com/python/cpython
8155e0e541
patch for sharing single character Unicode objects. Martin's patch had to be reworked in a number of ways to take Unicode resizing into consideration as well. Here's what the updated patch implements: * Single character Unicode strings in the Latin-1 range are shared (not only ASCII chars as in Martin's original patch). * The ASCII and Latin-1 codecs make use of this optimization, providing a noticable speedup for single character strings. Most Unicode methods can use the optimization as well (by virtue of using PyUnicode_FromUnicode()). * Some code cleanup was done (replacing memcpy with Py_UNICODE_COPY) * The PyUnicode_Resize() can now also handle the case of resizing unicode_empty which previously resulted in an error. * Modified the internal API _PyUnicode_Resize() and the public PyUnicode_Resize() API to handle references to shared objects correctly. The _PyUnicode_Resize() signature changed due to this. * Callers of PyUnicode_FromUnicode() may now only modify the Unicode object contents of the returned object in case they called the API with NULL as content template. Note that even though this patch passes the regression tests, there may still be subtle bugs in the sharing code. |
||
---|---|---|
.. | ||
Python.h | ||
abstract.h | ||
bitset.h | ||
bufferobject.h | ||
cStringIO.h | ||
cellobject.h | ||
ceval.h | ||
classobject.h | ||
cobject.h | ||
codecs.h | ||
compile.h | ||
complexobject.h | ||
config.h | ||
dictobject.h | ||
errcode.h | ||
eval.h | ||
fileobject.h | ||
floatobject.h | ||
frameobject.h | ||
funcobject.h | ||
graminit.h | ||
grammar.h | ||
import.h | ||
intobject.h | ||
intrcheck.h | ||
iterobject.h | ||
listobject.h | ||
longintrepr.h | ||
longobject.h | ||
marshal.h | ||
metagrammar.h | ||
methodobject.h | ||
modsupport.h | ||
moduleobject.h | ||
node.h | ||
object.h | ||
objimpl.h | ||
opcode.h | ||
osdefs.h | ||
parsetok.h | ||
patchlevel.h | ||
pgenheaders.h | ||
py_curses.h | ||
pydebug.h | ||
pyerrors.h | ||
pyfpe.h | ||
pygetopt.h | ||
pymem.h | ||
pyport.h | ||
pystate.h | ||
pythonrun.h | ||
pythread.h | ||
rangeobject.h | ||
rename1.h | ||
sliceobject.h | ||
stringobject.h | ||
structmember.h | ||
symtable.h | ||
sysmodule.h | ||
token.h | ||
traceback.h | ||
tupleobject.h | ||
ucnhash.h | ||
unicodeobject.h |