About alignment

22 views
Skip to first unread message

Pierre Chatelier

unread,
Nov 16, 2015, 11:53:53 AM11/16/15
to yeppp-discuss
Hi,

Reading the examples, I only see Yeppp process data that it has allocated itself with proper alignment.
My concern is to use Yeppp when possible on data that may not be properly aligned.
What are the good practices/functions/macros to check for alignment, convert native data types to Yeppp data types and process data ?

Marat Dukhan

unread,
Nov 16, 2015, 1:25:13 PM11/16/15
to Pierre Chatelier, yeppp-discuss

Sorry for the copy - replying to the mailing list this time.

Hi,

Yeppp! only requires the data to be naturally aligned (i.e. 4-byte types must be aligned on 4 bytes, 8-byte types must be aligned on 8 bytes, etc). This is a critical requirement for portability: some architectures do not support processing of misaligned data, and therefore such code can't be portable.

If you allocate memory with malloc, new, or alloca, your data is already naturally aligned, and there is nothing to worry about.

Regards,
Marat

--
You received this message because you are subscribed to the Google Groups "yeppp-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to yeppp-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages