Author: sebor Date: Sat Jul 19 16:25:45 2008 New Revision: 678239 URL: http://svn.apache.org/viewvc?rev=678239&view=rev Log: 2008-07-19 Martin Sebor <[EMAIL PROTECTED]>
STDCXX-997 * src/strtol.cpp [__SUNPRO_CC] (__rw_strtol, __rw_strtoul): Used #pragma no_side_effects to help Sun C++ optimizer generate better code (about 5% improvement was measured). [__SUNPRO_CC && _RWSTD_LONG_LONG] (__rw_strtoll, __rw_strtoull): Same. Modified: stdcxx/branches/4.2.x/src/strtol.h Modified: stdcxx/branches/4.2.x/src/strtol.h URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/src/strtol.h?rev=678239&r1=678238&r2=678239&view=diff ============================================================================== --- stdcxx/branches/4.2.x/src/strtol.h (original) +++ stdcxx/branches/4.2.x/src/strtol.h Sat Jul 19 16:25:45 2008 @@ -22,7 +22,7 @@ * implied. See the License for the specific language governing * permissions and limitations under the License. * - * Copyright 1994-2006 Rogue Wave Software. + * Copyright 1994-2008 Rogue Wave Software, Inc. * **************************************************************************/ @@ -35,11 +35,14 @@ _RWSTD_EXPORT extern const unsigned char __rw_digit_map[]; + +// same as strtoul() except that the source sequence must start +// with a sign (either '+' or '-') unsigned long - __rw_strtoul (const char*, int*, int); +__rw_strtoul (const char*, int*, int); long - __rw_strtol (const char*, int*, int); +__rw_strtol (const char*, int*, int); #ifdef _RWSTD_LONG_LONG @@ -77,4 +80,20 @@ #endif // _RWSTD_LONG_LONG +#ifdef __SUNPRO_CC + + // tell the Sun C++ optimizer that the functions do not access + // for reading or writing any part of the program state (either + // visible at in the caller at the point of the call, or not) +# pragma no_side_effect (__rw_strtoul) +# pragma no_side_effect (__rw_strtol) + +# ifdef _RWSTD_LONG_LONG +# pragma no_side_effect (__rw_strtoull) +# pragma no_side_effect (__rw_strtoll) +# endif // _RWSTD_LONG_LONG + +#endif // Sun C++ + + } // namespace __rw