diff options
author | Dhruv Matani <dhruvbird@gmx.net> | 2004-06-07 21:56:16 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2004-06-07 21:56:16 +0000 |
commit | 345b912f506bad61fcd703b6aa405a3a94f01024 (patch) | |
tree | 6e35a5c861a70677daa5f1bfb65b1d67caa7ae1e /libstdc++-v3 | |
parent | 85bbb21f8f810152bf51558180f7c6520aca6571 (diff) | |
download | gcc-345b912f506bad61fcd703b6aa405a3a94f01024.zip gcc-345b912f506bad61fcd703b6aa405a3a94f01024.tar.gz gcc-345b912f506bad61fcd703b6aa405a3a94f01024.tar.bz2 |
2004-06-07 Dhruv Matani <dhruvbird@gmx.net>
Paolo Carlini <pcarlini@suse.de>
* testsuite/testsuite_performance.h
(resource_counter::allocated_memory): Make it return the right
number of bytes requested by the allocators/application. This is
the sbrk+mmaped memory.
Co-Authored-By: Paolo Carlini <pcarlini@suse.de>
From-SVN: r82725
Diffstat (limited to 'libstdc++-v3')
-rw-r--r-- | libstdc++-v3/ChangeLog | 8 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/testsuite_performance.h | 38 |
2 files changed, 36 insertions, 10 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 06c30f7..8e210ce 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,11 @@ +2004-06-07 Dhruv Matani <dhruvbird@gmx.net> + Paolo Carlini <pcarlini@suse.de> + + * testsuite/testsuite_performance.h + (resource_counter::allocated_memory): Make it return the right + number of bytes requested by the allocators/application. This is + the sbrk+mmaped memory. + 2004-06-02 Gabriel Dos Reis <gdr@integrable-solutions.net> * include/std/std_complex.h (log): Tidy. diff --git a/libstdc++-v3/testsuite/testsuite_performance.h b/libstdc++-v3/testsuite/testsuite_performance.h index 56b02bc..a0d0c29 100644 --- a/libstdc++-v3/testsuite/testsuite_performance.h +++ b/libstdc++-v3/testsuite/testsuite_performance.h @@ -43,16 +43,33 @@ #elif defined (__FreeBSD__) extern "C" { - struct mallinfo { int uordblks; }; - struct mallinfo mallinfo(void) - { struct mallinfo m = { (((size_t) sbrk (0) + 1023) / 1024) }; return m; } + struct mallinfo + { + int uordblks; + int hblkhd; + }; + + struct mallinfo + mallinfo(void) + { + struct mallinfo m = { (((size_t) sbrk (0) + 1023) / 1024), 0 }; + return m; + } } #else extern "C" { - struct mallinfo { int uordblks; }; - struct mallinfo empty = { 0 }; - struct mallinfo mallinfo(void) { return empty; } + struct mallinfo + { + int uordblks; + int hblkhd; + }; + + struct mallinfo empty = { 0, 0 }; + + struct mallinfo + mallinfo(void) + { return empty; } } #endif @@ -101,9 +118,9 @@ namespace __gnu_test class resource_counter { - int who; - rusage rusage_begin; - rusage rusage_end; + int who; + rusage rusage_begin; + rusage rusage_end; struct mallinfo allocation_begin; struct mallinfo allocation_end; @@ -139,7 +156,8 @@ namespace __gnu_test int allocated_memory() const - { return allocation_end.uordblks - allocation_begin.uordblks; } + { return ((allocation_end.uordblks - allocation_begin.uordblks) + + (allocation_end.hblkhd - allocation_begin.hblkhd)); } long hard_page_fault() const |