[cairo] fix alignment issue on SPARC processors

Uli Schlachter psychon at znc.in
Fri Dec 5 05:59:06 PST 2014

Hi Nicolas,

Am 04.12.2014 um 20:44 schrieb Nicolas Setton:
>> I would instead suggest to add a new member "int64_t data" to the struct with a
>> suitable comment explaining why it is of type int64_t. Instead of using
>> ((unsigned char *)chunk + sizeof(*chunk)) for calculating the beginning of the
>> data area of the chunk, the code could then use (unsigned char*)&chunk->data
>> which IMO is more readable anyway.
> I didn't understand this suggestion.

Could you test the attached patch? Also, this is pretty much the idea that I had
in mind. Compared to your patch, it does not add a hole to struct _pool_chunk on
64bit platforms (in fact, nothing should change at all on 64bit).

I basically did no testing at all on this. The test suite run on the image
backend does not crash. So it would also be nice if others could take a look at
this and spot my mistakes. Pointer arithmetic is scary.

"In the beginning the Universe was created. This has made a lot of
 people very angry and has been widely regarded as a bad move."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-tor-scan-converter-Correctly-align-64bit-types.patch
Type: text/x-diff
Size: 5752 bytes
Desc: not available
URL: <http://lists.cairographics.org/archives/cairo/attachments/20141205/7bf51fc1/attachment.patch>

More information about the cairo mailing list