]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
massif: add C++ aligned operator new to allocator functions
authorPaul Floyd <pjfloyd@wanadoo.fr>
Fri, 3 Nov 2023 20:40:22 +0000 (21:40 +0100)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Fri, 3 Nov 2023 20:40:22 +0000 (21:40 +0100)
Also make the unsigned (32bit) and unsigned long (64bit) for size_t
conditional on the wordsize.

massif/ms_main.c
massif/tests/culling1.stderr.exp
massif/tests/culling2.stderr.exp
massif/tests/deep-B.stderr.exp
massif/tests/deep-C.stderr.exp
massif/tests/overloaded-new.cpp
massif/tests/overloaded-new.post.exp
massif/tests/overloaded-new.post.exp-freebsd
massif/tests/overloaded-new.post.exp-x86-freebsd-gcc
massif/tests/peak2.stderr.exp
massif/tests/realloc.stderr.exp

index 0957349a0a2b2d5898f0eb1cb10e8d83cb389e80..572a9d999c0f26ddda8f5e27b902672d0bd9d830 100644 (file)
@@ -298,6 +298,12 @@ static void init_alloc_fns(void)
    // prodigiously stupid overloading that caused them to not allocate
    // memory.
    //
+   // PJF: the above comment is a bit wide of the mark.
+   // See https://en.cppreference.com/w/cpp/memory/new/operator_new
+   // There are two "non-allocating placement allocation functions"
+   //
+   // Because of the above we can't use wildcards.
+   //
    // XXX: because we don't look at the first stack entry (unless it's a
    // custom allocation) there's not much point to having all these alloc
    // functions here -- they should never appear anywhere (I think?) other
@@ -309,20 +315,37 @@ static void init_alloc_fns(void)
    //
    DO("malloc"                                              );
    DO("__builtin_new"                                       );
+# if VG_WORDSIZE == 4
    DO("operator new(unsigned)"                              );
+#else
    DO("operator new(unsigned long)"                         );
+#endif
    DO("__builtin_vec_new"                                   );
+# if VG_WORDSIZE == 4
    DO("operator new[](unsigned)"                            );
+#else
    DO("operator new[](unsigned long)"                       );
+#endif
    DO("calloc"                                              );
    DO("realloc"                                             );
    DO("memalign"                                            );
    DO("posix_memalign"                                      );
    DO("valloc"                                              );
+# if VG_WORDSIZE == 4
    DO("operator new(unsigned, std::nothrow_t const&)"       );
    DO("operator new[](unsigned, std::nothrow_t const&)"     );
+   DO("operator new(unsigned, std::align_val_t al)"         );
+   DO("operator new[](unsigned, std::align_val_t al)"       );
+   DO("operator new(unsigned, std::align_val_t al, const std::nothrow_t&)"   );
+   DO("operator new[](unsigned, std::align_val_t al, const std::nothrow_t&)" );
+#else
    DO("operator new(unsigned long, std::nothrow_t const&)"  );
    DO("operator new[](unsigned long, std::nothrow_t const&)");
+   DO("operator new(unsigned long, std::align_val_t al)"    );
+   DO("operator new[](unsigned long, std::align_val_t al)"  );
+   DO("operator new(unsigned long, std::align_val_t al, const std::nothrow_t&)"   );
+   DO("operator new[](unsigned long, std::align_val_t al, const std::nothrow_t&)" );
+#endif
 #if defined(VGO_darwin)
    DO("malloc_zone_malloc"                                  );
    DO("malloc_zone_calloc"                                  );
index 19858ff34e7efb54099831aec7f6186dff253a11..fc21b91d2ebc713e652523bf655f725f4085886e 100644 (file)
@@ -1,20 +1,20 @@
 Massif: alloc-fns:
 Massif:   malloc
 Massif:   __builtin_new
-Massif:   operator new(unsigned)
 Massif:   operator new(unsigned long)
 Massif:   __builtin_vec_new
-Massif:   operator new[](unsigned)
 Massif:   operator new[](unsigned long)
 Massif:   calloc
 Massif:   realloc
 Massif:   memalign
 Massif:   posix_memalign
 Massif:   valloc
-Massif:   operator new(unsigned, std::nothrow_t const&)
-Massif:   operator new[](unsigned, std::nothrow_t const&)
 Massif:   operator new(unsigned long, std::nothrow_t const&)
 Massif:   operator new[](unsigned long, std::nothrow_t const&)
+Massif:   operator new(unsigned long, std::align_val_t al)
+Massif:   operator new[](unsigned long, std::align_val_t al)
+Massif:   operator new(unsigned long, std::align_val_t al, const std::nothrow_t&)
+Massif:   operator new[](unsigned long, std::align_val_t al, const std::nothrow_t&)
 Massif: ignore-fns:
 Massif:   0: __part_load_locale
 Massif:   1: __time_load_locale
index 0454d158b126e5642c1917e84806d087bd37863e..0100cf21c0af33f1d0612685f2909a2c28b0c437 100644 (file)
@@ -1,20 +1,20 @@
 Massif: alloc-fns:
 Massif:   malloc
 Massif:   __builtin_new
-Massif:   operator new(unsigned)
 Massif:   operator new(unsigned long)
 Massif:   __builtin_vec_new
-Massif:   operator new[](unsigned)
 Massif:   operator new[](unsigned long)
 Massif:   calloc
 Massif:   realloc
 Massif:   memalign
 Massif:   posix_memalign
 Massif:   valloc
-Massif:   operator new(unsigned, std::nothrow_t const&)
-Massif:   operator new[](unsigned, std::nothrow_t const&)
 Massif:   operator new(unsigned long, std::nothrow_t const&)
 Massif:   operator new[](unsigned long, std::nothrow_t const&)
+Massif:   operator new(unsigned long, std::align_val_t al)
+Massif:   operator new[](unsigned long, std::align_val_t al)
+Massif:   operator new(unsigned long, std::align_val_t al, const std::nothrow_t&)
+Massif:   operator new[](unsigned long, std::align_val_t al, const std::nothrow_t&)
 Massif: ignore-fns:
 Massif:   0: __part_load_locale
 Massif:   1: __time_load_locale
index 74187be5d44d927e7a1e8988dc60ddae1ad6ea1b..9bfee37b94488704e719dc5bf17664f15388d321 100644 (file)
@@ -1,20 +1,20 @@
 Massif: alloc-fns:
 Massif:   malloc
 Massif:   __builtin_new
-Massif:   operator new(unsigned)
 Massif:   operator new(unsigned long)
 Massif:   __builtin_vec_new
-Massif:   operator new[](unsigned)
 Massif:   operator new[](unsigned long)
 Massif:   calloc
 Massif:   realloc
 Massif:   memalign
 Massif:   posix_memalign
 Massif:   valloc
-Massif:   operator new(unsigned, std::nothrow_t const&)
-Massif:   operator new[](unsigned, std::nothrow_t const&)
 Massif:   operator new(unsigned long, std::nothrow_t const&)
 Massif:   operator new[](unsigned long, std::nothrow_t const&)
+Massif:   operator new(unsigned long, std::align_val_t al)
+Massif:   operator new[](unsigned long, std::align_val_t al)
+Massif:   operator new(unsigned long, std::align_val_t al, const std::nothrow_t&)
+Massif:   operator new[](unsigned long, std::align_val_t al, const std::nothrow_t&)
 Massif:   a6
 Massif:   a7
 Massif:   a8
index e1b72951a3fab754a3c838cc9bae8d0aa52f4289..956c72782886fed371493f8a24e1d7c9cd2df028 100644 (file)
@@ -1,20 +1,20 @@
 Massif: alloc-fns:
 Massif:   malloc
 Massif:   __builtin_new
-Massif:   operator new(unsigned)
 Massif:   operator new(unsigned long)
 Massif:   __builtin_vec_new
-Massif:   operator new[](unsigned)
 Massif:   operator new[](unsigned long)
 Massif:   calloc
 Massif:   realloc
 Massif:   memalign
 Massif:   posix_memalign
 Massif:   valloc
-Massif:   operator new(unsigned, std::nothrow_t const&)
-Massif:   operator new[](unsigned, std::nothrow_t const&)
 Massif:   operator new(unsigned long, std::nothrow_t const&)
 Massif:   operator new[](unsigned long, std::nothrow_t const&)
+Massif:   operator new(unsigned long, std::align_val_t al)
+Massif:   operator new[](unsigned long, std::align_val_t al)
+Massif:   operator new(unsigned long, std::align_val_t al, const std::nothrow_t&)
+Massif:   operator new[](unsigned long, std::align_val_t al, const std::nothrow_t&)
 Massif:   a3
 Massif:   a4
 Massif:   a5
index 8fb87078b65e15ec74c9c11a1c640eb76584d8a6..c79646cdcc0ce21fb5a5451c9cca2b2cfe407f4d 100644 (file)
@@ -34,14 +34,44 @@ __attribute__((noinline)) void* operator new[] (std::size_t n, std::nothrow_t co
     return malloc(n);
 }
 
+__attribute__((noinline)) void* operator new (std::size_t size, std::align_val_t al)
+{
+    return aligned_alloc(static_cast<std::size_t>(al), size);
+}
+
+__attribute__((noinline)) void* operator new[] (std::size_t size, std::align_val_t al)
+{
+    return aligned_alloc(static_cast<std::size_t>(al), size);
+}
+
+__attribute__((noinline)) void* operator new(std::size_t size, std::align_val_t al, const std::nothrow_t&) noexcept
+{
+    return aligned_alloc(static_cast<std::size_t>(al), size);
+}
+
+__attribute__((noinline)) void* operator new[](std::size_t size, std::align_val_t al, const std::nothrow_t&) noexcept
+{
+    return aligned_alloc(static_cast<std::size_t>(al), size);
+}
+
 __attribute__((noinline)) void operator delete (void* p)
 {
-    return free(p);
+    free(p);
 }
 
 __attribute__((noinline)) void operator delete[] (void* p)
 {
-    return free(p);
+    free(p);
+}
+
+__attribute__((noinline))  void operator delete (void* ptr, std::align_val_t al ) noexcept
+{
+    free(ptr);
+}
+
+__attribute__((noinline))  void operator delete[] (void* ptr, std::align_val_t al ) noexcept
+{
+    free(ptr);
 }
 
 int main(void)
@@ -50,10 +80,19 @@ int main(void)
     s*        p2 = new (std::nothrow) s;
     char*     c1 = new                char[2000];
     char*     c2 = new (std::nothrow) char[2000];
+    s*        pa1 = static_cast<s*>(operator new(sizeof(*pa1), static_cast<std::align_val_t>(256U)));
+    s*        pa2 = static_cast<s*>(operator new[](sizeof(*pa2)*10U, static_cast<std::align_val_t>(256U)));
+    std::nothrow_t tag;
+    s*        pa3 = static_cast<s*>(operator new(sizeof(*pa3), static_cast<std::align_val_t>(256U), tag));
+    s*        pa4 = static_cast<s*>(operator new[](sizeof(*pa4)*10U, static_cast<std::align_val_t>(256U), tag));
     delete p1;
     delete p2;
     delete [] c1;
     delete [] c2;
+    operator delete(pa1, static_cast<std::align_val_t>(256U));
+    operator delete(pa2, static_cast<std::align_val_t>(256U));
+    operator delete(pa3, static_cast<std::align_val_t>(256U));
+    operator delete(pa4, static_cast<std::align_val_t>(256U));
     return 0;
 }
 
index ae112710b7f8284e004eb250f4fe4f043422701e..81206a892b9057aa4c2818837383f6258ac77e91 100644 (file)
@@ -6,31 +6,31 @@ ms_print arguments: massif.out
 
 
     KB
-11.75^                                    ###########                         
-     |                                    #                                   
-     |                                    #                                   
-     |                                    #                                   
-     |                             :::::::#                                   
-     |                             :      #                                   
-     |                             :      #                                   
-     |                       :::::::      #          ::::::::::::             
-     |                       :     :      #          :                        
-     |                       :     :      #          :                        
-     |                       :     :      #          :                        
-     |                       :     :      #          :                        
-     |                       :     :      #          :                        
-     |                       :     :      #          :                        
-     |           :::::::::::::     :      #          :           ::::::       
-     |           :           :     :      #          :           :            
-     |           :           :     :      #          :           :            
-     |           :           :     :      #          :           :     :::::: 
-     |           :           :     :      #          :           :     :      
-     |           :           :     :      #          :           :     :      
+98.28^                                    #                                   
+     |                                    #:                                  
+     |                                    #:::                                
+     |                                    #::::                               
+     |                                    #:::::::::::::::::::                
+     |                                    #:::::                              
+     |                                    #:::::                              
+     |                                    #:::::                              
+     |                     :::::::::::::::#:::::                              
+     |                    ::              #:::::                              
+     |                    ::              #:::::                              
+     |                    ::              #:::::                              
+     |                    ::              #:::::              :               
+     |                    ::              #:::::              ::::::::::::::: 
+     |                    ::              #:::::              ::              
+     |                    ::              #:::::              ::              
+     |                    ::              #:::::              ::              
+     |     :::::::::::::::::              #:::::              ::              
+     |    ::              ::              #:::::              ::              
+     |  ::::              ::              #:::::              ::              
    0 +----------------------------------------------------------------------->KB
-     0                                                                   23.50
+     0                                                                   196.6
 
-Number of snapshots: 10
- Detailed snapshots: [5 (peak)]
+Number of snapshots: 18
+ Detailed snapshots: [9 (peak)]
 
 --------------------------------------------------------------------------------
   n        time(B)         total(B)   useful-heap(B) extra-heap(B)    stacks(B)
@@ -40,20 +40,36 @@ Number of snapshots: 10
   2          8,016            8,016            8,000            16            0
   3         10,024           10,024           10,000            24            0
   4         12,032           12,032           12,000            32            0
-  5         12,032           12,032           12,000            32            0
-99.73% (12,000B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
-->33.24% (4,000B) 0x........: main (overloaded-new.cpp:49)
+  5         16,216           16,216           16,000           216            0
+  6         56,368           56,368           56,000           368            0
+  7         60,392           60,392           60,000           392            0
+  8        100,640          100,640          100,000           640            0
+  9        100,640          100,640          100,000           640            0
+99.36% (100,000B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->39.75% (40,000B) 0x........: main (overloaded-new.cpp:84)
 | 
-->33.24% (4,000B) 0x........: main (overloaded-new.cpp:50)
+->39.75% (40,000B) 0x........: main (overloaded-new.cpp:87)
 | 
-->16.62% (2,000B) 0x........: main (overloaded-new.cpp:51)
+->03.97% (4,000B) 0x........: main (overloaded-new.cpp:79)
 | 
-->16.62% (2,000B) 0x........: main (overloaded-new.cpp:52)
+->03.97% (4,000B) 0x........: main (overloaded-new.cpp:80)
+| 
+->03.97% (4,000B) 0x........: main (overloaded-new.cpp:83)
+| 
+->03.97% (4,000B) 0x........: main (overloaded-new.cpp:86)
+| 
+->01.99% (2,000B) 0x........: main (overloaded-new.cpp:81)
+| 
+->01.99% (2,000B) 0x........: main (overloaded-new.cpp:82)
   
 --------------------------------------------------------------------------------
   n        time(B)         total(B)   useful-heap(B) extra-heap(B)    stacks(B)
 --------------------------------------------------------------------------------
-  6         16,040            8,024            8,000            24            0
-  7         20,048            4,016            4,000            16            0
-  8         22,056            2,008            2,000             8            0
-  9         24,064                0                0             0            0
+ 10        104,648           96,632           96,000           632            0
+ 11        108,656           92,624           92,000           624            0
+ 12        110,664           90,616           90,000           616            0
+ 13        112,672           88,608           88,000           608            0
+ 14        116,856           84,424           84,000           424            0
+ 15        157,008           44,272           44,000           272            0
+ 16        161,032           40,248           40,000           248            0
+ 17        201,280                0                0             0            0
index 5ea3666c08a9aec7b397586aed007ddf8aa9cbd0..d74cde8a8f89649264834511287317da1148acfb 100644 (file)
@@ -6,31 +6,31 @@ ms_print arguments: massif.out
 
 
     KB
-82.76^                                    #                                   
-     |                                  ::#::                                 
-     |                                ::::#: :                                
-     |                              ::: ::#: :::::::::::::::::::::::::::::::: 
-     |                              : : ::#: :::                              
-     |                              : : ::#: :::                              
-     |                              : : ::#: :::                              
-     |                              : : ::#: :::                              
-     |                              : : ::#: :::                              
-     |                              : : ::#: :::                              
-     |                              : : ::#: :::                              
-     |                              : : ::#: :::                              
-     |                              : : ::#: :::                              
-     |                              : : ::#: :::                              
-     |                              : : ::#: :::                              
-     |                              : : ::#: :::                              
-     |                              : : ::#: :::                              
-     |                              : : ::#: :::                              
-     |                              : : ::#: :::                              
-     |                              : : ::#: :::                              
+169.2^                                    #                                   
+     |                                    #:                                  
+     |                                    #::::::::::                         
+     |                                    #:::                                
+     |                                    #:::                                
+     |                           :::::::::#:::                                
+     |                          ::        #:::                                
+     |                          ::        #:::       :::::::::                
+     |                          ::        #:::       ::                       
+     |                          ::        #:::       ::                       
+     |                  ::::::::::        #:::       ::                       
+     |                :::       ::        #:::       ::                       
+     |               ::::       ::        #:::       ::       ::::::::::::::: 
+     |               ::::       ::        #:::       ::       :               
+     |               ::::       ::        #:::       ::       :               
+     |               ::::       ::        #:::       ::       :               
+     |               ::::       ::        #:::       ::       :               
+     |               ::::       ::        #:::       ::       :               
+     |               ::::       ::        #:::       ::       :               
+     |               ::::       ::        #:::       ::       :               
    0 +----------------------------------------------------------------------->KB
-     0                                                                   165.5
+     0                                                                   338.3
 
-Number of snapshots: 12
- Detailed snapshots: [6 (peak)]
+Number of snapshots: 20
+ Detailed snapshots: [9, 10 (peak)]
 
 --------------------------------------------------------------------------------
   n        time(B)         total(B)   useful-heap(B) extra-heap(B)    stacks(B)
@@ -41,26 +41,67 @@ Number of snapshots: 12
   3         80,728           80,728           80,704            24            0
   4         82,736           82,736           82,704            32            0
   5         84,744           84,744           84,704            40            0
-  6         84,744           84,744           84,704            40            0
-99.95% (84,704B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
-->85.79% (72,704B) 0x........: ??? (in /usr/local/lib/gcc/libstdc++.so.6.0.28)
-| ->85.79% (72,704B) 0x........: ??? (in /libexec/ld-elf.so.1)
-|   ->85.79% (72,704B) 0x........: ??? (in /libexec/ld-elf.so.1)
-|     ->85.79% (72,704B) 0x........: ??? (in /libexec/ld-elf.so.1)
+  6         88,960           88,960           88,704           256            0
+  7        129,144          129,144          128,704           440            0
+  8        133,200          133,200          132,704           496            0
+  9        173,224          173,224          172,704           520            0
+99.70% (172,704B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->41.97% (72,704B) 0x........: ??? (in /usr/local/lib/gcc/libstdc++.so.6.0.28)
+| ->41.97% (72,704B) 0x........: ??? (in /libexec/ld-elf.so.1)
+|   ->41.97% (72,704B) 0x........: ??? (in /libexec/ld-elf.so.1)
+|     ->41.97% (72,704B) 0x........: ??? (in /libexec/ld-elf.so.1)
 |       
-->04.72% (4,000B) 0x........: main (overloaded-new.cpp:49)
+->23.09% (40,000B) 0x........: main (overloaded-new.cpp:84)
 | 
-->04.72% (4,000B) 0x........: main (overloaded-new.cpp:50)
+->23.09% (40,000B) 0x........: main (overloaded-new.cpp:87)
 | 
-->02.36% (2,000B) 0x........: main (overloaded-new.cpp:51)
+->02.31% (4,000B) 0x........: main (overloaded-new.cpp:79)
 | 
-->02.36% (2,000B) 0x........: main (overloaded-new.cpp:52)
+->02.31% (4,000B) 0x........: main (overloaded-new.cpp:80)
+| 
+->02.31% (4,000B) 0x........: main (overloaded-new.cpp:83)
+| 
+->02.31% (4,000B) 0x........: main (overloaded-new.cpp:86)
+| 
+->01.15% (2,000B) 0x........: main (overloaded-new.cpp:81)
+| 
+->01.15% (2,000B) 0x........: main (overloaded-new.cpp:82)
+  
+--------------------------------------------------------------------------------
+  n        time(B)         total(B)   useful-heap(B) extra-heap(B)    stacks(B)
+--------------------------------------------------------------------------------
+ 10        173,224          173,224          172,704           520            0
+99.70% (172,704B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->41.97% (72,704B) 0x........: ??? (in /usr/local/lib/gcc/libstdc++.so.6.0.28)
+| ->41.97% (72,704B) 0x........: ??? (in /libexec/ld-elf.so.1)
+|   ->41.97% (72,704B) 0x........: ??? (in /libexec/ld-elf.so.1)
+|     ->41.97% (72,704B) 0x........: ??? (in /libexec/ld-elf.so.1)
+|       
+->23.09% (40,000B) 0x........: main (overloaded-new.cpp:84)
+| 
+->23.09% (40,000B) 0x........: main (overloaded-new.cpp:87)
+| 
+->02.31% (4,000B) 0x........: main (overloaded-new.cpp:79)
+| 
+->02.31% (4,000B) 0x........: main (overloaded-new.cpp:80)
+| 
+->02.31% (4,000B) 0x........: main (overloaded-new.cpp:83)
+| 
+->02.31% (4,000B) 0x........: main (overloaded-new.cpp:86)
+| 
+->01.15% (2,000B) 0x........: main (overloaded-new.cpp:81)
+| 
+->01.15% (2,000B) 0x........: main (overloaded-new.cpp:82)
   
 --------------------------------------------------------------------------------
   n        time(B)         total(B)   useful-heap(B) extra-heap(B)    stacks(B)
 --------------------------------------------------------------------------------
-  7         88,752           80,736           80,704            32            0
-  8         92,760           76,728           76,704            24            0
-  9         94,768           74,720           74,704            16            0
- 10         96,776           72,712           72,704             8            0
- 11        169,488                0                0             0            0
+ 11        177,232          169,216          168,704           512            0
+ 12        181,240          165,208          164,704           504            0
+ 13        183,248          163,200          162,704           496            0
+ 14        185,256          161,192          160,704           488            0
+ 15        189,472          156,976          156,704           272            0
+ 16        229,656          116,792          116,704            88            0
+ 17        233,712          112,736          112,704            32            0
+ 18        273,736           72,712           72,704             8            0
+ 19        346,448                0                0             0            0
index 5d99373d6917e616b2eca3934b2253d76815e110..5d5e0a44c12fa542f83ec2706a8935a701863b8f 100644 (file)
@@ -6,31 +6,31 @@ ms_print arguments: massif.out
 
 
     KB
-30.26^                                    ####                                
-     |                                    #                                   
-     |                                 :::#                                   
-     |                               :::  #   :::::                           
-     |                               : :  #   :                               
-     |                               : :  #   :                               
-     |                          :::::: :  #   :    ::                         
-     |                          :    : :  #   :    : ::                       
-     |                      :::::    : :  #   :    : : :::::::::::::::::::::: 
-     |                      :   :    : :  #   :    : : :                      
-     |                      :   :    : :  #   :    : : :                      
-     |                      :   :    : :  #   :    : : :                      
-     |                      :   :    : :  #   :    : : :                      
-     |                      :   :    : :  #   :    : : :                      
-     |                      :   :    : :  #   :    : : :                      
-     |                      :   :    : :  #   :    : : :                      
-     |                      :   :    : :  #   :    : : :                      
-     |                      :   :    : :  #   :    : : :                      
-     |                      :   :    : :  #   :    : : :                      
-     |                      :   :    : :  #   :    : : :                      
+116.9^                                    #                                   
+     |                                    #:                                  
+     |                                    #:::                                
+     |                                    #:::::::::::::::                    
+     |                                    #::::                               
+     |                                    #::::                               
+     |                                    #::::                               
+     |                       :::::::::::::#::::                               
+     |                      ::            #::::                               
+     |                      ::            #::::                               
+     |                      ::            #::::           ::                  
+     |                      ::            #::::           : ::::::::::::      
+     |                      ::            #::::           : :                 
+     |                      ::            #::::           : :                 
+     |                      ::            #::::           : :                 
+     |         :::::::::::::::            #::::           : :                 
+     |        :::           ::            #::::           : :                 
+     |     ::::::           ::            #::::           : :           ::::: 
+     |     :: :::           ::            #::::           : :           :     
+     |     :: :::           ::            #::::           : :           :     
    0 +----------------------------------------------------------------------->KB
-     0                                                                   60.52
+     0                                                                   233.7
 
-Number of snapshots: 12
- Detailed snapshots: [6 (peak)]
+Number of snapshots: 20
+ Detailed snapshots: [9, 10 (peak)]
 
 --------------------------------------------------------------------------------
   n        time(B)         total(B)   useful-heap(B) extra-heap(B)    stacks(B)
@@ -41,26 +41,67 @@ Number of snapshots: 12
   3         26,968           26,968           26,944            24            0
   4         28,976           28,976           28,944            32            0
   5         30,984           30,984           30,944            40            0
-  6         30,984           30,984           30,944            40            0
-99.87% (30,944B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
-->61.14% (18,944B) 0x........: ??? (in /usr/local/lib/gcc/libstdc++.so.6.0.28)
-| ->61.14% (18,944B) 0x........: ??? (in /libexec/ld-elf.so.1)
-|   ->61.14% (18,944B) 0x........: ??? (in /libexec/ld-elf.so.1)
-|     ->61.14% (18,944B) 0x........: ??? (in /libexec/ld-elf.so.1)
+  6         35,184           35,184           34,944           240            0
+  7         75,352           75,352           74,944           408            0
+  8         79,392           79,392           78,944           448            0
+  9        119,656          119,656          118,944           712            0
+99.40% (118,944B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->33.43% (40,000B) 0x........: main (overloaded-new.cpp:84)
+| 
+->33.43% (40,000B) 0x........: main (overloaded-new.cpp:87)
+| 
+->15.83% (18,944B) 0x........: ??? (in /usr/local/lib32/gcc/libstdc++.so.6.0.30)
+| ->15.83% (18,944B) 0x........: ??? (in /libexec/ld-elf32.so.1)
+|   ->15.83% (18,944B) 0x........: ??? (in /libexec/ld-elf32.so.1)
+|     ->15.83% (18,944B) 0x........: ??? (in /libexec/ld-elf32.so.1)
+|       
+->03.34% (4,000B) 0x........: main (overloaded-new.cpp:79)
+| 
+->03.34% (4,000B) 0x........: main (overloaded-new.cpp:80)
+| 
+->03.34% (4,000B) 0x........: main (overloaded-new.cpp:83)
+| 
+->03.34% (4,000B) 0x........: main (overloaded-new.cpp:86)
+| 
+->01.67% (2,000B) 0x........: main (overloaded-new.cpp:81)
+| 
+->01.67% (2,000B) 0x........: main (overloaded-new.cpp:82)
+  
+--------------------------------------------------------------------------------
+  n        time(B)         total(B)   useful-heap(B) extra-heap(B)    stacks(B)
+--------------------------------------------------------------------------------
+ 10        119,656          119,656          118,944           712            0
+99.40% (118,944B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
+->33.43% (40,000B) 0x........: main (overloaded-new.cpp:84)
+| 
+->33.43% (40,000B) 0x........: main (overloaded-new.cpp:87)
+| 
+->15.83% (18,944B) 0x........: ??? (in /usr/local/lib32/gcc/libstdc++.so.6.0.30)
+| ->15.83% (18,944B) 0x........: ??? (in /libexec/ld-elf32.so.1)
+|   ->15.83% (18,944B) 0x........: ??? (in /libexec/ld-elf32.so.1)
+|     ->15.83% (18,944B) 0x........: ??? (in /libexec/ld-elf32.so.1)
 |       
-->12.91% (4,000B) 0x........: main (overloaded-new.cpp:49)
+->03.34% (4,000B) 0x........: main (overloaded-new.cpp:79)
+| 
+->03.34% (4,000B) 0x........: main (overloaded-new.cpp:80)
+| 
+->03.34% (4,000B) 0x........: main (overloaded-new.cpp:83)
 | 
-->12.91% (4,000B) 0x........: main (overloaded-new.cpp:50)
+->03.34% (4,000B) 0x........: main (overloaded-new.cpp:86)
 | 
-->06.45% (2,000B) 0x........: main (overloaded-new.cpp:51)
+->01.67% (2,000B) 0x........: main (overloaded-new.cpp:81)
 | 
-->06.45% (2,000B) 0x........: main (overloaded-new.cpp:52)
+->01.67% (2,000B) 0x........: main (overloaded-new.cpp:82)
   
 --------------------------------------------------------------------------------
   n        time(B)         total(B)   useful-heap(B) extra-heap(B)    stacks(B)
 --------------------------------------------------------------------------------
-  7         34,992           26,976           26,944            32            0
-  8         39,000           22,968           22,944            24            0
-  9         41,008           20,960           20,944            16            0
- 10         43,016           18,952           18,944             8            0
- 11         61,968                0                0             0            0
+ 11        123,664          115,648          114,944           704            0
+ 12        127,672          111,640          110,944           696            0
+ 13        129,680          109,632          108,944           688            0
+ 14        131,688          107,624          106,944           680            0
+ 15        135,888          103,424          102,944           480            0
+ 16        176,056           63,256           62,944           312            0
+ 17        180,096           59,216           58,944           272            0
+ 18        220,360           18,952           18,944             8            0
+ 19        239,312                0                0             0            0
index 78d37b6663ae008201646b4fd015475596f42a17..9ffd1bc918b85d98c306c03749d5ae5b52e67019 100644 (file)
@@ -1,20 +1,20 @@
 Massif: alloc-fns:
 Massif:   malloc
 Massif:   __builtin_new
-Massif:   operator new(unsigned)
 Massif:   operator new(unsigned long)
 Massif:   __builtin_vec_new
-Massif:   operator new[](unsigned)
 Massif:   operator new[](unsigned long)
 Massif:   calloc
 Massif:   realloc
 Massif:   memalign
 Massif:   posix_memalign
 Massif:   valloc
-Massif:   operator new(unsigned, std::nothrow_t const&)
-Massif:   operator new[](unsigned, std::nothrow_t const&)
 Massif:   operator new(unsigned long, std::nothrow_t const&)
 Massif:   operator new[](unsigned long, std::nothrow_t const&)
+Massif:   operator new(unsigned long, std::align_val_t al)
+Massif:   operator new[](unsigned long, std::align_val_t al)
+Massif:   operator new(unsigned long, std::align_val_t al, const std::nothrow_t&)
+Massif:   operator new[](unsigned long, std::align_val_t al, const std::nothrow_t&)
 Massif: ignore-fns:
 Massif:   0: __part_load_locale
 Massif:   1: __time_load_locale
index 4ed52b26ba63343d9f3fc7caf76f4452131087e8..16d8f509173c132df0dec4d1e4580923eda2ffba 100644 (file)
@@ -1,20 +1,20 @@
 Massif: alloc-fns:
 Massif:   malloc
 Massif:   __builtin_new
-Massif:   operator new(unsigned)
 Massif:   operator new(unsigned long)
 Massif:   __builtin_vec_new
-Massif:   operator new[](unsigned)
 Massif:   operator new[](unsigned long)
 Massif:   calloc
 Massif:   realloc
 Massif:   memalign
 Massif:   posix_memalign
 Massif:   valloc
-Massif:   operator new(unsigned, std::nothrow_t const&)
-Massif:   operator new[](unsigned, std::nothrow_t const&)
 Massif:   operator new(unsigned long, std::nothrow_t const&)
 Massif:   operator new[](unsigned long, std::nothrow_t const&)
+Massif:   operator new(unsigned long, std::align_val_t al)
+Massif:   operator new[](unsigned long, std::align_val_t al)
+Massif:   operator new(unsigned long, std::align_val_t al, const std::nothrow_t&)
+Massif:   operator new[](unsigned long, std::align_val_t al, const std::nothrow_t&)
 Massif: ignore-fns:
 Massif:   0: __part_load_locale
 Massif:   1: __time_load_locale