raster pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=2636853b7f4b3f630af1403fcaaadd638354a1ee

commit 2636853b7f4b3f630af1403fcaaadd638354a1ee
Author: Carsten Haitzler (Rasterman) <[email protected]>
Date:   Wed Feb 12 21:11:18 2020 +0000

    eo - fix - fix alignment of eo object class structs - it was wrong
    
    the alignbment logic was wrong. we have to use the worst case. that
    means 8 or 16 byte alignment. eina mempool alignment logic is wrong
    for this as it assumes an array of typoes of all the same size...
    
    this fixes crashes seen on armv7 with sigbus in new gesture code which
    got unlucky.
    
    @fix
---
 src/lib/eo/eo_ptr_indirection.x | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/lib/eo/eo_ptr_indirection.x b/src/lib/eo/eo_ptr_indirection.x
index 2b3fa5a467..f0f34e0bc6 100644
--- a/src/lib/eo/eo_ptr_indirection.x
+++ b/src/lib/eo/eo_ptr_indirection.x
@@ -247,7 +247,12 @@ _eo_id_mem_protect(void *ptr, Eina_Bool may_not_write)
 # define UNPROTECT(_ptr_)
 #endif
 
-#define EO_ALIGN_SIZE(size) eina_mempool_alignof(size)
+#if __WORDSIZE == 32
+# define EO_ALIGN 16
+#else // __WORDSIZE == 64
+# define EO_ALIGN 8
+#endif
+#define EO_ALIGN_SIZE(size) (((size + EO_ALIGN - 1) / EO_ALIGN) * EO_ALIGN)
 
 /* Entry */
 typedef struct

-- 


Reply via email to