<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/cpython-git.git/Objects/bytes_methods.c, 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-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-40170: Add _PyIndex_Check() internal function (GH-19426)</title>
<updated>2020-04-08T00:01:56+00:00</updated>
<author>
<name>Victor Stinner</name>
<email>vstinner@python.org</email>
</author>
<published>2020-04-08T00:01:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=a15e260b708a98edaba86a2aa663c3f6b2abc964'/>
<id>a15e260b708a98edaba86a2aa663c3f6b2abc964</id>
<content type='text'>
Add _PyIndex_Check() function to the internal C API: fast inlined
verson of PyIndex_Check().

Add Include/internal/pycore_abstract.h header file.

Replace PyIndex_Check() with _PyIndex_Check() in C files of Objects
and Python subdirectories.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add _PyIndex_Check() function to the internal C API: fast inlined
verson of PyIndex_Check().

Add Include/internal/pycore_abstract.h header file.

Replace PyIndex_Check() with _PyIndex_Check() in C files of Objects
and Python subdirectories.</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-35081: Move bytes_methods.h to the internal C API (GH-18492)</title>
<updated>2020-02-12T21:32:34+00:00</updated>
<author>
<name>Victor Stinner</name>
<email>vstinner@python.org</email>
</author>
<published>2020-02-12T21:32:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=45876a90e2663f12b90c2090ec3e48bd97841aae'/>
<id>45876a90e2663f12b90c2090ec3e48bd97841aae</id>
<content type='text'>
Move the bytes_methods.h header file to the internal C API as
pycore_bytes_methods.h: it only contains private symbols (prefixed by
"_Py"), except of the PyDoc_STRVAR_shared() macro.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Move the bytes_methods.h header file to the internal C API as
pycore_bytes_methods.h: it only contains private symbols (prefixed by
"_Py"), except of the PyDoc_STRVAR_shared() macro.</pre>
</div>
</content>
</entry>
<entry>
<title>closes bpo-39605: Fix some casts to not cast away const. (GH-18453)</title>
<updated>2020-02-12T02:28:35+00:00</updated>
<author>
<name>Andy Lester</name>
<email>andy@petdance.com</email>
</author>
<published>2020-02-12T02:28:35+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=e6be9b59a911626d6597fe148c32f0342bd2bd24'/>
<id>e6be9b59a911626d6597fe148c32f0342bd2bd24</id>
<content type='text'>
gcc -Wcast-qual turns up a number of instances of casting away constness of pointers. Some of these can be safely modified, by either:

Adding the const to the type cast, as in:

-    return _PyUnicode_FromUCS1((unsigned char*)s, size);
+    return _PyUnicode_FromUCS1((const unsigned char*)s, size);

or, Removing the cast entirely, because it's not necessary (but probably was at one time), as in:

-    PyDTrace_FUNCTION_ENTRY((char *)filename, (char *)funcname, lineno);
+    PyDTrace_FUNCTION_ENTRY(filename, funcname, lineno);

These changes will not change code, but they will make it much easier to check for errors in consts</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
gcc -Wcast-qual turns up a number of instances of casting away constness of pointers. Some of these can be safely modified, by either:

Adding the const to the type cast, as in:

-    return _PyUnicode_FromUCS1((unsigned char*)s, size);
+    return _PyUnicode_FromUCS1((const unsigned char*)s, size);

or, Removing the cast entirely, because it's not necessary (but probably was at one time), as in:

-    PyDTrace_FUNCTION_ENTRY((char *)filename, (char *)funcname, lineno);
+    PyDTrace_FUNCTION_ENTRY(filename, funcname, lineno);

These changes will not change code, but they will make it much easier to check for errors in consts</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-38383: Fix possible integer overflow in startswith() of bytes and bytearray. (GH-16603)</title>
<updated>2019-10-06T12:17:18+00:00</updated>
<author>
<name>Hai Shi</name>
<email>shihai1992@gmail.com</email>
</author>
<published>2019-10-06T12:17:18+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=24ddd9c2d6ab61cbce7e68d6de36d4df9bd2c3fb'/>
<id>24ddd9c2d6ab61cbce7e68d6de36d4df9bd2c3fb</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>closes bpo-34599: Improve performance of _Py_bytes_capitalize(). (GH-9083)</title>
<updated>2018-09-07T04:54:49+00:00</updated>
<author>
<name>Sergey Fedoseev</name>
<email>fedoseev.sergey@gmail.com</email>
</author>
<published>2018-09-07T04:54:49+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=593bb30e82eded7f2ec02f7d1aa49742e6962113'/>
<id>593bb30e82eded7f2ec02f7d1aa49742e6962113</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-20180: complete AC conversion of Objects/stringlib/transmogrify.h (GH-8039)</title>
<updated>2018-07-06T10:17:38+00:00</updated>
<author>
<name>Tal Einat</name>
<email>taleinat+github@gmail.com</email>
</author>
<published>2018-07-06T10:17:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=c929df3b96c8d7e7977e581431192be21cdafd19'/>
<id>c929df3b96c8d7e7977e581431192be21cdafd19</id>
<content type='text'>
* converted bytes methods: expandtabs, ljust, rjust, center, zfill
* updated char_convertor to properly set the C default value</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* converted bytes methods: expandtabs, ljust, rjust, center, zfill
* updated char_convertor to properly set the C default value</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-32677: Optimize str.isascii() (GH-5356)</title>
<updated>2018-01-28T00:59:12+00:00</updated>
<author>
<name>INADA Naoki</name>
<email>methane@users.noreply.github.com</email>
</author>
<published>2018-01-28T00:59:12+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=bea57060c863d0c3474c79350bd9c557f2ff0e7c'/>
<id>bea57060c863d0c3474c79350bd9c557f2ff0e7c</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-32677: Add .isascii() to str, bytes and bytearray (GH-5342)</title>
<updated>2018-01-27T05:06:21+00:00</updated>
<author>
<name>INADA Naoki</name>
<email>methane@users.noreply.github.com</email>
</author>
<published>2018-01-27T05:06:21+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=a49ac9902903a798fab4970ccf563c531199c3f8'/>
<id>a49ac9902903a798fab4970ccf563c531199c3f8</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
