> Looks like Solaris is not happy about unaligned accesses.

Many RISC processors don't like it; in some of them, the OS catches the
unaligned access trap and simulates the access (perhaps noisily, as I
think Digital UNIX does, printing a message on the controlling tty, and
probably slowly in any case), and, in others, the OS just sends a signal
to the process, as Solaris does.

(Some C compilers might be able to conclude, in some cases, that a
possibly-misaligned pointer is being used, and generate paranoid code in
those cases, or might, as Sun C does, support an "always be paranoid"
option:

     -misalign
          (SPARC) Informs the compiler that data is not  properly
          aligned  and  thus  very  conservative loads and stores
          must be used for data, that is, one  byte  at  a  time.
          Using  this  option  can  cause significant performance
          degradation when running the program.  If  you  compile
          and  link in separate steps, this option must appear on
          both the compile and link command lines.

     -misalign2
          (SPARC) Assumes that data is not properly aligned,  but
          that data is at least half-word aligned. Though conser-
          vative uses of loads and stores must be used for  data,
          the  performance  degradation when running a program is
          less than that seen for -misalign.  If you compile  and
          link in separate steps, this option must appear on both
          the compile and link command lines.

but it's probably best to avoid misaligned accesses.)
-
This is the TCPDUMP workers list. It is archived at
http://www.tcpdump.org/lists/workers/index.html
To unsubscribe use mailto:[EMAIL PROTECTED]?body=unsubscribe

Reply via email to