fix alignment issue on SPARC processors

Nicolas Setton <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
There is an alignment issue on SPARC processors which causes a SIGBUS when
trying to write data to edges in the polygon scan converter.

Here is the patch that we've applied to circumvent the issue. 

Hope this helps!

Nicolas

diff --git a/src/cairo-tor-scan-converter.c b/src/cairo-tor-scan-converter.c
index 14922d0..d811825 100644
--- a/src/cairo-tor-scan-converter.c
+++ b/src/cairo-tor-scan-converter.c
@@ -273,6 +273,11 @@ struct _pool_chunk {
     /* # bytes total in this chunk */
     size_t capacity;
 
+    /* Pad to fix alignment issue on sparc: the long long integers
+     * are aligned on 64-bit boundaries. Make sure that this is the
+     * case in the memory pool by bumping the size of this struct. */
+    short padding;
+
     /* Pointer to the previous chunk or %NULL if this is the sentinel
      * chunk in the pool header. */
     struct _pool_chunk *prev_chunk;

-- 
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.