Uploaded image for project: 'C++ Standard Library'
  1. C++ Standard Library
  2. STDCXX-817

[HP aCC 6.16] C++ runtime leaks memory

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: External
    • Labels:
      None
    • Environment:

      aCC: HP C/aC++ B3910B A.06.16 [Nov 26 2007]

    • Severity:
      Resource Leak

      Description

      The HP aCC 6.16 runtime on HP-UX/IPF leaks 16 bytes of memory:

      $ cat x.cpp && aCC -AA -V x.cpp && ./a.out 
      #include <stdio.h>
      #include <stdlib.h>
      #include <new>
      
      namespace std { }
      using namespace std;
      
      void* operator new (size_t n) throw (bad_alloc) {
          void* const ptr = malloc (n);
          fprintf (stderr, "operator new (%zu) ==> %p\n", n, ptr);
          return ptr;
      }
      
      void operator delete (void *ptr) throw () {
          fprintf (stderr, "operator delete (%p)\n", ptr);
          free (ptr);
      }
      
      void* operator new[] (size_t n) throw (bad_alloc) {
          void* const ptr = malloc (n);
          fprintf (stderr, "operator new[] (%zu) ==> %p\n", n, ptr);
          return ptr;
      }
      
      void operator delete[] (void *ptr) throw () {
          fprintf (stderr, "operator delete[] (%p)\n", ptr);
          free (ptr);
      }
      
      int main () {
          fprintf (stderr, "main\n");
      }
      aCC: HP C/aC++ B3910B A.06.16 [Nov 26 2007]
      ld: 92453-07 linker ld HP Itanium(R) B.12.41  IPF/IPF
      operator new (16) ==> 40012460
      main
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                sebor Martin Sebor
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated: