Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Systems: HP aC++ Release Notes > Chapter 1 HP aC++ Release Notes

New Features in Version A.03.65

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

HP aC++ version A.03.65 supports the following new features:

+Onolibcalls=func1[,func2,...] Option

Now, a list of function names can be specified as arguments to the +Onolibcalls option. The function names can be given after a '=' following the +Onolibcalls option.

If multiple function names have to be specified, they must be separated by commas as shown. There cannot be any intervening spaces or blanks. Multiple functions can also be specified with multiple +Onolibcalls options.

The functions specified are expected to be part of the millicode routines' library.

This new syntax of the +Onolibcalls option allows users to selectively disable the inlining of only the specified library routines. Previously, it was possible only to either inline all the library routines (using +Olibcalls) or to disable all of them (using +Onolibcalls).

Improved NRV Optimization

From this release, the compiler does further optimizations with NRV (Named Return Value optimization) to eliminate unnecessary calls with const initializations. For example:

#include <stdio.h> 

struct C {
         C() {}
        C(C const &) { printf(“Copy Constructorn”); }
};

const C func2() { return C(); }

int main() {
         const C b = func2();

In this case, the compiler eliminates the copy constructor call.

Improved Compile Time

With this release, there is a significant reduction in compile time for applications involving operator overloading and function overloading.

Debugging of Inline Functions

HP aC++ Version A.03.65 now supports debugging of inline functions. This feature enables you to set breakpoints and watch points, do 'step-in' and 'step-out', and display, view, or change the value of local variables in inline functions using WDB. To enable this feature, use the +inline_debug option, which will implicitly pass the -g option to the compiler.

Improved Template Usability

This version significantly improves the support for C++ template features with more conformance to the ISO/IEC 14882 C++ Standard. Specifically, support for member templates, argument deduction, partial specialization, and dependent name lookup have been improved.

Destruct Locals when pthread_exit is Called

When pthread_exit is called in multithreaded C++ applications, the exiting thread exits without calling destructors for the active local objects. This behavior is not always desirable, certain applications might require the destructors to be called for objects on the stack of exiting thread.

From this release, support is provided for calling destructors for active local objects when pthread_exit is called on a thread. To enable this feature, you need to set the environment variable aCC_PTHREAD_EXIT_CLEANUP=1|ON.

Consider the following example:

#include <pthread.h>#include <stdio.h>class A {public :	        A()  { printf("A()\n");  }	        ~A() { printf("~A()\n"); }};void foo() {        	A a2;        	pthread_exit((void *) 77);}void* bar(void *inThread) {        	A a1;        	foo();        	return 0;}int main() {        	pthread_t tid;        	if (pthread_create(&tid, 0, &bar, NULL)) {                		perror("pthread create failed\n");       	}        	pthread_join(tid, NULL);        	return 0;} 

With this feature enabled, for this example, both the constructors and destructors will be called for local variables a1 and a2 in functions foo and bar.

This feature requires exception handling info and if functions are compiled with +noeh, no destructors will be called with no indication of a problem. This is similar to mixing and matching +eh code with +noeh code and doing a throw across the mixture.

This feature is available only in the shared version of C++ runtime library and on HP-UX 11.x PA-RISC versions.

Accessing Members of Enclosing Class from a Nested Class

Prior to this release, the aCC compiler disallowed accessing of members of enclosing class from a nested class. Friend access was required for such cases. However, the C++ Standards Committee is planning to relax this restriction and this feature is implemented in many compilers.

With this release, a member of a class can also access all names as it accesses the names in the class of which it is a member:

class Enclosing {    static void f();    class Nested {    public:       void Help(Enclosing encl) {             Enclosing::f();    // ok, no error             encl.f();  	  // ok, no error       }   };};

Performance Improvement of Strings With -mt

Two changes have been made to increase performance of strings with -mt.

The first helps -AP strings. Locking is no longer done for the null string. This should eliminate thread contention when creating empty strings. This has always been available for -AA strings.

In the second, a new flag has been defined to reduce the amount of space for string mutexes and thereby increase performance when using either -AA or -AP strings.

Instead of having one mutex per string, there is now a fixed array of mutexes that are shared amongst all strings.

Because this feature requires a new runtime, it is enabled with -D__HPACC_FIXED_REFCNT_MUTEX and requires the following aC++ runtime patches:

PHSS_31855  'aC++ Runtime (IA:  A.05.61, PA  A.03.61)'     11.23PHSS_32573  'HP aC++ -AA runtime libraries (aCC A.03.61)'  11.11PHSS_32574  'HP aC++ -AA runtime libraries (aCC A.03.61)'  11.00
CAUTION: If the appropriate aC++ runtime patch is not installed, the following unsats will occur:
 HPMutexWrapper::init(int)  -AP
 _HPMutexWrapper::init(int) -AA

And the following new symbols are defined in aC++ runtime library (libCsup):

 __libCsup_mutex_alloc   __libCsup_mutex_context

The number of string mutexes defaults to 64 and can be configured by:

export aCC_MUTEX_ARRAY_SIZE=##

You can mix code compiled with and without -D__HPACC_FIXED_REFCNT_MUTEX provided you have the new aC++ runtime installed.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 2006 Hewlett-Packard Development Company, L.P.