Victor Stinner
a0dd0213cc
Close #17693 : Rewrite CJK decoders to use the _PyUnicodeWriter API instead of
the legacy Py_UNICODE API.
Add also a new _PyUnicodeWriter_WriteChar() function.
13 years ago
Antoine Pitrou
36b045f4db
Fix supernumerary 's' in sys._debugmallocstats() output.
13 years ago
Benjamin Peterson
c9314d9e08
don't run frame if it has no stack ( closes #17669 )
13 years ago
Victor Stinner
247109e74d
Issue #17615 : On Windows (VS2010), Performances of wmemcmp() to compare Unicode
strings are not convincing. For UCS2 (16-bit wchar_t type), use a dummy loop
instead of wmemcmp(). The dummy loop is as fast, or a little bit faster.
wchar_t is only 16-bit long on Windows. wmemcmp() is still used for 32-bit
wchar_t.
13 years ago
Victor Stinner
0cff4b16d9
replace(): only call PyUnicode_DATA(u) once
13 years ago
Victor Stinner
cc7af72192
Write super-fast version of str.strip(), str.lstrip() and str.rstrip() for pure ASCII
13 years ago
Victor Stinner
f50a4e9bc9
Don't calls macros in PyUnicode_WRITE() parameters
PyUnicode_WRITE() expands some parameters twice or more.
13 years ago
Victor Stinner
9c79e41fc5
Fix do_strip(): don't call PyUnicode_READ() in Py_UNICODE_ISSPACE() to not call
it twice
13 years ago
Victor Stinner
b3a6014504
Fix _PyUnicode_XStrip()
Inline the BLOOM_MEMBER() to only call PyUnicode_READ() only once (per loop
iteration). Store also the length of the seperator in a variable to avoid calls
to PyUnicode_GET_LENGTH().
13 years ago
Victor Stinner
63d5c1a14a
Optimize PyUnicode_DecodeCharmap()
Avoid expensive PyUnicode_READ() and PyUnicode_WRITE(), manipulate pointers
instead.
13 years ago
Victor Stinner
a85af502a4
Optimize make_bloom_mask(), used by str.strip(), str.lstrip() and str.rstrip()
Write specialized functions per Unicode kind to avoid the expensive
PyUnicode_READ() macro.
13 years ago
Victor Stinner
69ed0f4c86
Use PyUnicode_READ() instead of PyUnicode_READ_CHAR()
"PyUnicode_READ_CHAR() is less efficient than PyUnicode_READ() because it calls
PyUnicode_KIND() and might call it twice." according to its documentation.
13 years ago
Victor Stinner
03c3e35d42
Add fast-path in PyUnicode_DecodeCharmap() for pure 8 bit encodings:
cp037, cp500 and iso8859_1 codecs
13 years ago
Victor Stinner
cd777eaf53
Issue #17615 : Comparing two Unicode strings now uses wmemcmp() when possible
wmemcmp() is twice faster than a dummy loop (342 usec vs 744 usec) on Fedora
18/x86_64, GCC 4.7.2.
13 years ago
Victor Stinner
c1302bba4c
Issue #17615 : Expand expensive PyUnicode_READ() macro in unicode_compare():
write specialized functions for each combination of Unicode kinds.
13 years ago
Victor Stinner
7efa3b8242
Close #13126 : "Simplify" FASTSEARCH() code to help the compiler to emit more
efficient machine code. Patch written by Antoine Pitrou.
Without this change, str.find() was 10% slower than str.rfind() in the worst
case.
13 years ago
Serhiy Storchaka
278d03bd66
Revert a premature patch for issue #14010 (changeset aaaf36026511).
13 years ago
Serhiy Storchaka
e8f706eda7
Issue #14010 : Fix a crash when iterating or deleting deeply nested filters
(builting and in itertools module, i.e. map(), itertools.chain(), etc).
13 years ago
Antoine Pitrou
0aaaa62200
Issue #17469 : Fix _Py_GetAllocatedBlocks() and sys.getallocatedblocks() when running on valgrind.
13 years ago
Victor Stinner
207dd38726
fix unused variable
13 years ago
Victor Stinner
eb4b5ac8af
Close #16757 : Avoid calling the expensive _PyUnicode_FindMaxChar() function
when possible
13 years ago
Victor Stinner
cfc4c13b04
Add _PyUnicodeWriter_WriteSubstring() function
Write a function to enable more optimizations:
* If the substring is the whole string and overallocation is disabled, just
keep a reference to the string, don't copy characters
* Avoid a call to the expensive _PyUnicode_FindMaxChar() function when
possible
13 years ago
Benjamin Peterson
6395241471
list slotdefs in offset order rather than sorting them ( closes #17610 )
This means we can remove our usage of qsort() than relied on undefined behavior.
13 years ago
Antoine Pitrou
7faf70512a
Issue #17591 : Use lowercase filenames when including Windows header files.
Patch by Roumen Petrov.
13 years ago
Benjamin Peterson
da2c7ebd23
allow any type with __getitem__ to be a mapping for the purposes of % ( #15801 )
13 years ago
Raymond Hettinger
378170d5d9
Issue 17447: Clarify that str.isidentifier doesn't check for reserved keywords.
13 years ago
Kristján Valur Jónsson
1d108bc714
Issue #10211 : Buffer object should support the new buffer interface.
13 years ago
Benjamin Peterson
5589850c14
fix warning ( closes #17327 )
13 years ago
Benjamin Peterson
00e9886bd9
Add PyDict_SetDefault. ( closes #17327 )
Patch by Stefan Behnel and I.
13 years ago
Victor Stinner
2cb16aa3cb
_PyUnicode_Writer() now also reuses Unicode singletons:
empty string and latin1 single character
13 years ago
Victor Stinner
cf77da9fb5
Backed out changeset b9f7b1bf36aa
13 years ago
Victor Stinner
313cac88c5
Issue #17223 : Fix PyUnicode_FromUnicode() on Windows (16-bit wchar_t type)
to reject invalid UTF-16 surrogate.
13 years ago
Benjamin Peterson
b1efa53662
fix possible setdefault refleak ( closes #17328 )
13 years ago
Mark Dickinson
7cac1c25a1
Issue #16445 : Fix potential segmentation fault when deleting an exception message.
13 years ago
R David Murray
1cb0cb2fcd
#17296 : backport fix for issue 1692335, naive exception pickling.
13 years ago
Victor Stinner
d21b58c05d
Issue #17223 : Fix PyUnicode_FromUnicode() for string of 1 character outside
the range U+0000-U+10ffff.
13 years ago
Serhiy Storchaka
18809fa94e
Remove unused defines.
13 years ago
Benjamin Peterson
8e830a0664
fix building without pymalloc ( closes #17228 )
13 years ago
Benjamin Peterson
2dba1ee3e6
fix building without pymalloc ( closes #17228 )
13 years ago
Stefan Krah
674a42b114
Fix error messages.
13 years ago
R David Murray
5aff27aec1
#7963 : fix error message when 'object' called with arguments.
Patch by Alexander Belopolsky.
13 years ago
R David Murray
6b30759022
#7963 : fix error message when 'object' called with arguments.
Patch by Alexander Belopolsky.
13 years ago
Eric Snow
9d05c8c0e0
Issue #15022 : Ensure all pickle protocols are supported.
13 years ago
Eric Snow
b5c8f92782
Issue #15022 : Add pickle and comparison support to types.SimpleNamespace.
13 years ago
Serhiy Storchaka
5e61f14c6d
Issue #12983 : Bytes literals with invalid \x escape now raise a SyntaxError
and a full traceback including line number.
13 years ago
Antoine Pitrou
4de7457009
Issue #17173 : Remove uses of locale-dependent C functions (isalpha() etc.) in the interpreter.
I've left a couple of them in: zlib (third-party lib), getaddrinfo.c
(doesn't include Python.h, and probably obsolete), _sre.c (legitimate
use for the re.LOCALE flag).
13 years ago
Victor Stinner
bbbac2ec34
Issue #17137 : When an Unicode string is resized, the internal wide character
string (wstr) format is now cleared.
13 years ago
Serhiy Storchaka
3fd4ab356d
Issue #17043 : The unicode-internal decoder no longer read past the end of
input buffer.
13 years ago
Serhiy Storchaka
d5327d95d2
Issue #17043 : The unicode-internal decoder no longer read past the end of
input buffer.
13 years ago
Serhiy Storchaka
f458a03617
Issue #17034 : Use Py_CLEAR() in bytesobject.c.
13 years ago