PATCH (not worthy of gcc-patches): Add memory report for __FreeBSD__
Loren James Rittle
rittle@latour.rsch.comm.mot.com
Fri Aug 8 07:59:00 GMT 2003
Reworked patch in my tree for long while to limit damage and committed
it to mainline. I think this should be safe on a random POSIX machine
but I must leave it to another to promote it to more platforms after
at least a spot check. - Loren
(This implementation was produced after looking at this line of
<malloc.h>: 'int uordblks; /* total allocated space */'. I had no
idea what units that was in but 1K seemed reasonable.)
* testsuite/testsuite_performance.h (__FreeBSD__): Add fake mallinfo.
Index: libstdc++-v3/testsuite/testsuite_performance.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/testsuite_performance.h,v
retrieving revision 1.7
diff -c -r1.7 testsuite_performance.h
*** libstdc++-v3/testsuite/testsuite_performance.h 24 Jul 2003 21:07:29 -0000 1.7
--- libstdc++-v3/testsuite/testsuite_performance.h 8 Aug 2003 07:28:27 -0000
***************
*** 40,45 ****
--- 40,52 ----
#ifdef __linux__
#include <malloc.h>
+ #elif defined (__FreeBSD__)
+ extern "C"
+ {
+ struct mallinfo { int uordblks; };
+ struct mallinfo mallinfo(void)
+ { struct mallinfo m = { (((size_t) sbrk (0) + 1023) / 1024) }; return m; }
+ }
#else
extern "C"
{
More information about the Libstdc++
mailing list