]> git.saurik.com Git - redis.git/commitdiff
Fix crash on SPARC due to improper alignment of allocated memory
authorChris Lamb <lamby@debian.org>
Wed, 16 Nov 2011 17:21:16 +0000 (17:21 +0000)
committerChris Lamb <lamby@debian.org>
Wed, 16 Nov 2011 17:21:16 +0000 (17:21 +0000)
I believe that you should be able to drop 'defined(__sun)' completely
from this clause, as Solaris on x86 hardware probably does not have
strict alignment requirements, but I don't have a way to test that.

Thanks to Jurij Smakov <jurij@wooyd.org>.

Signed-off-by: Chris Lamb <lamby@debian.org>
src/zmalloc.c

index 5408c2fafaafc1269fdef8ae8fb81299a987e264..56b9140c9ea4bde1fac312a63ef482728b77a2f5 100644 (file)
@@ -38,7 +38,7 @@
 #ifdef HAVE_MALLOC_SIZE
 #define PREFIX_SIZE (0)
 #else
-#if defined(__sun)
+#if defined(__sun) || defined(__sparc) || defined(__sparc__)
 #define PREFIX_SIZE (sizeof(long long))
 #else
 #define PREFIX_SIZE (sizeof(size_t))