+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.
#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
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;
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