Sun Studio 12 Update 1: C++ User's Guide

Examples

The following table shows how you can use -xmemalign to handle different alignment situations.

Table A–39 Examples of -xmemalign

Command 

Situation  

-xmemalign=1s

All memory accesses are misaligned so trap handling is too slow. 

-xmemalign=8i

There are occasional, intentional, misaligned accesses in code that is otherwise correct. 

-xmemalign=8s

There should be no misaligned accesses in the program. 

-xmemalign=2s

You want to check for possible odd-byte accesses. 

-xmemalign=2i

You want to check for possible odd-byte access and you want the program to work.