<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/cpython-git.git/Objects/stringlib, branch enum-lost-fixes</title>
<subtitle>github.com: python/cpython.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/'/>
<entry>
<title>bpo-43179: Generalise alignment for optimised string routines (GH-24624)</title>
<updated>2021-03-31T10:12:39+00:00</updated>
<author>
<name>Jessica Clarke</name>
<email>jrtc27@jrtc27.com</email>
</author>
<published>2021-03-31T10:12:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=dec075754960dd85972ce5170df76e862f966132'/>
<id>dec075754960dd85972ce5170df76e862f966132</id>
<content type='text'>
* Remove m68k-specific hack from ascii_decode

On m68k, alignments of primitives is more relaxed, with 4-byte and
8-byte types only requiring 2-byte alignment, thus using sizeof(size_t)
does not work. Instead, use the portable alternative.

Note that this is a minimal fix that only relaxes the assertion and the
condition for when to use the optimised version remains overly strict.
Such issues will be fixed tree-wide in the next commit.

NB: In C11 we could use _Alignof(size_t) instead, but for compatibility
we use autoconf.

* Optimise string routines for architectures with non-natural alignment

C only requires that sizeof(x) is a multiple of alignof(x), not that the
two are equal. Thus anywhere where we optimise based on alignment we
should be using alignof(x) not sizeof(x).

This is more annoying than it would be in C11 where we could just use
_Alignof(x) (and alignof(x) in C++11), but since we still require only
C99 we must plumb the information all the way from autoconf through the
various typedefs and defines.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Remove m68k-specific hack from ascii_decode

On m68k, alignments of primitives is more relaxed, with 4-byte and
8-byte types only requiring 2-byte alignment, thus using sizeof(size_t)
does not work. Instead, use the portable alternative.

Note that this is a minimal fix that only relaxes the assertion and the
condition for when to use the optimised version remains overly strict.
Such issues will be fixed tree-wide in the next commit.

NB: In C11 we could use _Alignof(size_t) instead, but for compatibility
we use autoconf.

* Optimise string routines for architectures with non-natural alignment

C only requires that sizeof(x) is a multiple of alignof(x), not that the
two are equal. Thus anywhere where we optimise based on alignment we
should be using alignof(x) not sizeof(x).

This is more annoying than it would be in C11 where we could just use
_Alignof(x) (and alignof(x) in C++11), but since we still require only
C99 we must plumb the information all the way from autoconf through the
various typedefs and defines.</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-41972: Use the two-way algorithm for string searching (GH-22904)</title>
<updated>2021-02-28T18:20:50+00:00</updated>
<author>
<name>Dennis Sweeney</name>
<email>36520290+sweeneyde@users.noreply.github.com</email>
</author>
<published>2021-02-28T18:20:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=73a85c4e1da42db28e3de57c868d24a089b8d277'/>
<id>73a85c4e1da42db28e3de57c868d24a089b8d277</id>
<content type='text'>
Implement an enhanced variant of Crochemore and Perrin's Two-Way string searching algorithm, which reduces worst-case time from quadratic (the product of the string and pattern lengths) to linear. This applies to forward searches (like``find``, ``index``, ``replace``); the algorithm for reverse searches (like ``rfind``) is not changed.

Co-authored-by: Tim Peters &lt;tim.peters@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Implement an enhanced variant of Crochemore and Perrin's Two-Way string searching algorithm, which reduces worst-case time from quadratic (the product of the string and pattern lengths) to linear. This applies to forward searches (like``find``, ``index``, ``replace``); the algorithm for reverse searches (like ``rfind``) is not changed.

Co-authored-by: Tim Peters &lt;tim.peters@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-42519: Replace PyObject_MALLOC() with PyObject_Malloc() (GH-23587)</title>
<updated>2020-12-01T09:37:39+00:00</updated>
<author>
<name>Victor Stinner</name>
<email>vstinner@python.org</email>
</author>
<published>2020-12-01T09:37:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=32bd68c839adb7b42af12366ab0892303115d1d1'/>
<id>32bd68c839adb7b42af12366ab0892303115d1d1</id>
<content type='text'>
No longer use deprecated aliases to functions:

* Replace PyObject_MALLOC() with PyObject_Malloc()
* Replace PyObject_REALLOC() with PyObject_Realloc()
* Replace PyObject_FREE() with PyObject_Free()
* Replace PyObject_Del() with PyObject_Free()
* Replace PyObject_DEL() with PyObject_Free()</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
No longer use deprecated aliases to functions:

* Replace PyObject_MALLOC() with PyObject_Malloc()
* Replace PyObject_REALLOC() with PyObject_Realloc()
* Replace PyObject_FREE() with PyObject_Free()
* Replace PyObject_Del() with PyObject_Free()
* Replace PyObject_DEL() with PyObject_Free()</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-42519: Replace PyMem_MALLOC() with PyMem_Malloc() (GH-23586)</title>
<updated>2020-12-01T08:56:42+00:00</updated>
<author>
<name>Victor Stinner</name>
<email>vstinner@python.org</email>
</author>
<published>2020-12-01T08:56:42+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=00d7abd7ef588fc4ff0571c8579ab4aba8ada1c0'/>
<id>00d7abd7ef588fc4ff0571c8579ab4aba8ada1c0</id>
<content type='text'>
No longer use deprecated aliases to functions:

* Replace PyMem_MALLOC() with PyMem_Malloc()
* Replace PyMem_REALLOC() with PyMem_Realloc()
* Replace PyMem_FREE() with PyMem_Free()
* Replace PyMem_Del() with PyMem_Free()
* Replace PyMem_DEL() with PyMem_Free()

Modify also the PyMem_DEL() macro to use directly PyMem_Free().</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
No longer use deprecated aliases to functions:

* Replace PyMem_MALLOC() with PyMem_Malloc()
* Replace PyMem_REALLOC() with PyMem_Realloc()
* Replace PyMem_FREE() with PyMem_Free()
* Replace PyMem_Del() with PyMem_Free()
* Replace PyMem_DEL() with PyMem_Free()

Modify also the PyMem_DEL() macro to use directly PyMem_Free().</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-38252: Use 8-byte step to detect ASCII sequence in 64bit Windows build (GH-16334)</title>
<updated>2020-10-18T14:48:38+00:00</updated>
<author>
<name>Ma Lin</name>
<email>animalize@users.noreply.github.com</email>
</author>
<published>2020-10-18T14:48:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=a0c603cb9d4dbb9909979313a88bcd1f5fde4f62'/>
<id>a0c603cb9d4dbb9909979313a88bcd1f5fde4f62</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-40521: Make empty Unicode string per interpreter (GH-21096)</title>
<updated>2020-06-23T22:10:40+00:00</updated>
<author>
<name>Victor Stinner</name>
<email>vstinner@python.org</email>
</author>
<published>2020-06-23T22:10:40+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=f363d0a6e9cfa50677a6de203735fbc0d06c2f49'/>
<id>f363d0a6e9cfa50677a6de203735fbc0d06c2f49</id>
<content type='text'>
Each interpreter now has its own empty Unicode string singleton.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Each interpreter now has its own empty Unicode string singleton.</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-40521: Make bytes singletons per interpreter (GH-21074)</title>
<updated>2020-06-23T13:54:35+00:00</updated>
<author>
<name>Victor Stinner</name>
<email>vstinner@python.org</email>
</author>
<published>2020-06-23T13:54:35+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=c41eed1a874e2f22bde45c3c89418414b7a37f46'/>
<id>c41eed1a874e2f22bde45c3c89418414b7a37f46</id>
<content type='text'>
Each interpreter now has its own empty bytes string and single byte
character singletons.

Replace STRINGLIB_EMPTY macro with STRINGLIB_GET_EMPTY() macro.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Each interpreter now has its own empty bytes string and single byte
character singletons.

Replace STRINGLIB_EMPTY macro with STRINGLIB_GET_EMPTY() macro.</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-29882: Add _Py_popcount32() function (GH-20518)</title>
<updated>2020-06-08T14:30:33+00:00</updated>
<author>
<name>Victor Stinner</name>
<email>vstinner@python.org</email>
</author>
<published>2020-06-08T14:30:33+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=c6b292cdeee689f0bfac6c1e2c2d4e4e01fa8d9e'/>
<id>c6b292cdeee689f0bfac6c1e2c2d4e4e01fa8d9e</id>
<content type='text'>
* Rename pycore_byteswap.h to pycore_bitutils.h.
* Move popcount_digit() to pycore_bitutils.h as _Py_popcount32().
* _Py_popcount32() uses GCC and clang builtin function if available.
* Add unit tests to _Py_popcount32().</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Rename pycore_byteswap.h to pycore_bitutils.h.
* Move popcount_digit() to pycore_bitutils.h as _Py_popcount32().
* _Py_popcount32() uses GCC and clang builtin function if available.
* Add unit tests to _Py_popcount32().</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-40792: Make the result of PyNumber_Index() always having exact type int. (GH-20443)</title>
<updated>2020-05-28T07:33:45+00:00</updated>
<author>
<name>Serhiy Storchaka</name>
<email>storchaka@gmail.com</email>
</author>
<published>2020-05-28T07:33:45+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=5f4b229df7812f1788287095eb6b138bb21876a4'/>
<id>5f4b229df7812f1788287095eb6b138bb21876a4</id>
<content type='text'>
Previously, the result could have been an instance of a subclass of int.

Also revert bpo-26202 and make attributes start, stop and step of the range
object having exact type int.

Add private function _PyNumber_Index() which preserves the old behavior
of PyNumber_Index() for performance to use it in the conversion functions
like PyLong_AsLong().</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, the result could have been an instance of a subclass of int.

Also revert bpo-26202 and make attributes start, stop and step of the range
object having exact type int.

Add private function _PyNumber_Index() which preserves the old behavior
of PyNumber_Index() for performance to use it in the conversion functions
like PyLong_AsLong().</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-37999: No longer use __int__ in implicit integer conversions. (GH-15636)</title>
<updated>2020-05-26T15:43:38+00:00</updated>
<author>
<name>Serhiy Storchaka</name>
<email>storchaka@gmail.com</email>
</author>
<published>2020-05-26T15:43:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=578c3955e0222ec7b3146197467fbb0fcfae12fe'/>
<id>578c3955e0222ec7b3146197467fbb0fcfae12fe</id>
<content type='text'>
Only __index__ should be used to make integer conversions lossless.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Only __index__ should be used to make integer conversions lossless.
</pre>
</div>
</content>
</entry>
</feed>
