This discussion is archived
2 Replies Latest reply: Sep 19, 2012 9:46 AM by NikMolchanov RSS

How can I align starting address of a function in shared library?

NikMolchanov Newbie
Currently Being Moderated
We use C++ from Oracle Solaris Studio (latest version) to build our 64-bit shared library,
and we found out that there is ~10% performance fluctuation depending on the build server,
that we use to link this shared library. For some reason starting address of one hot function
in this library may not be aligned to 16 bytes, and in this case the performance of this function
is low. Is there a way to tell C++ compiler to align this function (or all functions) to 16 bytes?

Our build servers are Solaris 10 SPARC. Performance is measured on T4 and M3000.
Compiler options are: -xO4 -xtarget=generic -g

Thanks.
Nik

Edited by: NikMolchanov on Sep 15, 2012 4:46 PM

Edited by: NikMolchanov on Sep 15, 2012 4:47 PM

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points