Serhiy Storchaka <storch...@gmail.com> added the comment:

> +#if SIZEOF_LONG <= SIZEOF_VOID_P
> +    if (!((size_t) p & LONG_PTR_MASK)) {
> 
> I wrote "q", not "p". You have to check p and q alignement to be able
> to dereference p and q pointers.

Initial q (destination) is always pointer-aligned, because PyASCIIObject is 
pointer-aligned. If PyASCIIObject not aligned, then on this platform alignment 
does not matter. But initial p (source) can be non-aligned. If the initial p 
and q are not equally aligned, then they will not be able to be aligned in the 
future, and the whole loop shall be omitted.

> sizeof(long) <= sizeof(void*) is always true.

Some memory models in I8086 processor had a 4-byte long and a 2-byte pointer. 
It is already in the past, but some modern processors can be 8-byte long and a 
4-byte pointer. I do not know, whether there are such. If you think this 
condition is unnecessary, we can remove it.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue14419>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to