Message182430
> It must be about pointer alignment, because that's the whole point of
> the ASSERT.
Indeed, it's about pointer alignment, but it's not about the CPU. It's
about the compiler (or the platform's C ABI).
Apparently the compiler doesn't align struct fields to natural
boundaries like most other compilers do, which means the size of the
PyASCIIObject struct (in unicodeobject.h) ends up not being a multiple
of 4, which in turn means the "dest" pointer (allocated from the end of
that structure) is not 4 byte-aligned either.
However, you can probably safely remove the assert(), since it is there
to warn about misalignment on platforms which *are* alignment-sensitive.
There is another assert() of the same kind in unicodeobject.c, which you
can remove too.
It would be nice if the C source could be improved here, but it's not
obvious which rule to enforce exactly. We want to be lenient if the
misalignment is a product of the compiler's alignment rules, but not if
it's a mistake on our part.
Which compiler is it? |
|
Date |
User |
Action |
Args |
2013-02-19 21:02:21 | pitrou | set | recipients:
+ pitrou, jcea, christian.heimes, trent, ezio.melotti, alanh, skrah, Ramchandra Apte, serhiy.storchaka |
2013-02-19 21:02:21 | pitrou | link | issue17237 messages |
2013-02-19 21:02:21 | pitrou | create | |
|