<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/cpython-git.git/Python/pyhash.c, branch v3.8.9</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>[3.8] closes bpo-40184: Only define pysiphash if the hash algorithm is SIPHASH24. (GH-19373)</title>
<updated>2020-04-04T21:46:54+00:00</updated>
<author>
<name>Benjamin Peterson</name>
<email>benjamin@python.org</email>
</author>
<published>2020-04-04T21:46:54+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=411555075401aa831a2228196c2d8f9a54b6f577'/>
<id>411555075401aa831a2228196c2d8f9a54b6f577</id>
<content type='text'>
(cherry picked from commit 1b21573)

Co-authored-by: Batuhan Taşkaya &lt;batuhanosmantaskaya@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
(cherry picked from commit 1b21573)

Co-authored-by: Batuhan Taşkaya &lt;batuhanosmantaskaya@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>closes bpo-39605: Fix some casts to not cast away const. (GH-18453)</title>
<updated>2020-02-12T02:47:20+00:00</updated>
<author>
<name>Miss Islington (bot)</name>
<email>31488909+miss-islington@users.noreply.github.com</email>
</author>
<published>2020-02-12T02:47:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=190433d8150bf719fa0ba972dbacf2214942f54e'/>
<id>190433d8150bf719fa0ba972dbacf2214942f54e</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
(cherry picked from commit e6be9b59a911626d6597fe148c32f0342bd2bd24)

Co-authored-by: Andy Lester &lt;andy@petdance.com&gt;</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
(cherry picked from commit e6be9b59a911626d6597fe148c32f0342bd2bd24)

Co-authored-by: Andy Lester &lt;andy@petdance.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-31849: Fix warning in pyhash.c (GH-6799)</title>
<updated>2018-06-04T10:57:08+00:00</updated>
<author>
<name>A. Jesse Jiryu Davis</name>
<email>jesse@emptysquare.net</email>
</author>
<published>2018-06-04T10:57:08+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=a8eb58546b37a7cd5f332f019bb07388f5212c2d'/>
<id>a8eb58546b37a7cd5f332f019bb07388f5212c2d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-28055: Fix unaligned accesses in siphash24(). (GH-6123)</title>
<updated>2018-05-13T10:57:31+00:00</updated>
<author>
<name>Rolf Eike Beer</name>
<email>eike@sf-mail.de</email>
</author>
<published>2018-05-13T10:57:31+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=1e2ec8a996daec65d8d5a3d43b66a9909c6d0653'/>
<id>1e2ec8a996daec65d8d5a3d43b66a9909c6d0653</id>
<content type='text'>
The hash implementation casts the input pointer to uint64_t* and directly reads
from this, which may cause unaligned accesses. Use memcpy() instead so this code
will not crash with SIGBUS on sparc.

https://bugs.gentoo.org/show_bug.cgi?id=636400</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The hash implementation casts the input pointer to uint64_t* and directly reads
from this, which may cause unaligned accesses. Use memcpy() instead so this code
will not crash with SIGBUS on sparc.

https://bugs.gentoo.org/show_bug.cgi?id=636400</pre>
</div>
</content>
</entry>
<entry>
<title>Fix some warnings produced by different compilers. (#5593)</title>
<updated>2018-02-09T15:31:26+00:00</updated>
<author>
<name>Serhiy Storchaka</name>
<email>storchaka@gmail.com</email>
</author>
<published>2018-02-09T15:31:26+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=bfe4fd5f2e96e72eecb5b8a0c7df0ac1689f3b7e'/>
<id>bfe4fd5f2e96e72eecb5b8a0c7df0ac1689f3b7e</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-32460: ensure all non-static globals have initializers (#5061)</title>
<updated>2017-12-31T18:04:13+00:00</updated>
<author>
<name>Benjamin Peterson</name>
<email>benjamin@python.org</email>
</author>
<published>2017-12-31T18:04:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=0a37a30037073a4a9ba45e560c8445048e5f2ba2'/>
<id>0a37a30037073a4a9ba45e560c8445048e5f2ba2</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>byte swap the raw hash secrets (more bpo-32260) (#4773)</title>
<updated>2017-12-09T21:11:39+00:00</updated>
<author>
<name>Benjamin Peterson</name>
<email>benjamin@python.org</email>
</author>
<published>2017-12-09T21:11:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=60ed1308304964e5648d8bfc9b74bd549570fa83'/>
<id>60ed1308304964e5648d8bfc9b74bd549570fa83</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-32260: don't byte swap siphash keys (#4771)</title>
<updated>2017-12-09T19:24:18+00:00</updated>
<author>
<name>Benjamin Peterson</name>
<email>benjamin@python.org</email>
</author>
<published>2017-12-09T19:24:18+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=4e3e156391e70cd23cae18f2629ec323b3b1e7de'/>
<id>4e3e156391e70cd23cae18f2629ec323b3b1e7de</id>
<content type='text'>
Reference siphash takes the keys as a bytes, so it makes sense to byte swap
when reifying the keys as 64-bit integers. However, Python's siphash takes host
integers in to start with.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reference siphash takes the keys as a bytes, so it makes sense to byte swap
when reifying the keys as 64-bit integers. However, Python's siphash takes host
integers in to start with.</pre>
</div>
</content>
</entry>
<entry>
<title>closes bpo-31650: PEP 552 (Deterministic pycs) implementation (#4575)</title>
<updated>2017-12-09T18:26:52+00:00</updated>
<author>
<name>Benjamin Peterson</name>
<email>benjamin@python.org</email>
</author>
<published>2017-12-09T18:26:52+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=42aa93b8ff2f7879282b06efc73a31ec7785e602'/>
<id>42aa93b8ff2f7879282b06efc73a31ec7785e602</id>
<content type='text'>
Python now supports checking bytecode cache up-to-dateness with a hash of the
source contents rather than volatile source metadata. See the PEP for details.

While a fairly straightforward idea, quite a lot of code had to be modified due
to the pervasiveness of pyc implementation details in the codebase. Changes in
this commit include:

- The core changes to importlib to understand how to read, validate, and
  regenerate hash-based pycs.

- Support for generating hash-based pycs in py_compile and compileall.

- Modifications to our siphash implementation to support passing a custom
  key. We then expose it to importlib through _imp.

- Updates to all places in the interpreter, standard library, and tests that
  manually generate or parse pyc files to grok the new format.

- Support in the interpreter command line code for long options like
  --check-hash-based-pycs.

- Tests and documentation for all of the above.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Python now supports checking bytecode cache up-to-dateness with a hash of the
source contents rather than volatile source metadata. See the PEP for details.

While a fairly straightforward idea, quite a lot of code had to be modified due
to the pervasiveness of pyc implementation details in the codebase. Changes in
this commit include:

- The core changes to importlib to understand how to read, validate, and
  regenerate hash-based pycs.

- Support for generating hash-based pycs in py_compile and compileall.

- Modifications to our siphash implementation to support passing a custom
  key. We then expose it to importlib through _imp.

- Updates to all places in the interpreter, standard library, and tests that
  manually generate or parse pyc files to grok the new format.

- Support in the interpreter command line code for long options like
  --check-hash-based-pycs.

- Tests and documentation for all of the above.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add the const qualifier to "char *" variables that refer to literal strings. (#4370)</title>
<updated>2017-11-11T11:06:26+00:00</updated>
<author>
<name>Serhiy Storchaka</name>
<email>storchaka@gmail.com</email>
</author>
<published>2017-11-11T11:06:26+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=e2f92de6a90ae11a6d8e01bd17fd88b005516835'/>
<id>e2f92de6a90ae11a6d8e01bd17fd88b005516835</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
