Message156896
> +#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. |
|
Date |
User |
Action |
Args |
2012-03-27 06:32:29 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, pitrou, vstinner |
2012-03-27 06:32:29 | serhiy.storchaka | link | issue14419 messages |
2012-03-27 06:32:28 | serhiy.storchaka | create | |
|