This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Counting amount of memory allocated?
- From: Chris Lattner <sabre at nondot dot org>
- To: Benjamin Kosnik <bkoz at redhat dot com>
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Mon, 4 Nov 2002 22:57:01 -0600 (CST)
- Subject: Re: Counting amount of memory allocated?
> >Is there a 3.2 compatible solution to this problem? Is __USE_MALLOC still
> >available? I am running in a single threaded context, so at least those
> >headaches shouldn't be a problem.
>
> No to the first two.
Ok, thanks. :)
> I'm hoping this work gets moved over though. I just did the symbol
> versioning support for it, so I think it could get moved without
> breaking the ABI.
Another idea... is there a (perhaps non-portable, perhaps ugly) way to ask
the libstdc++ pool allocator how much memory is allocated but not used
yet? I could (nasty, I know, but effective) #ifdef by GCC version number
to make it fall back to the current "heuristic" if not compiling with the
right version of GCC, so it would be somewhat portable.
So is there an api, documented and stable (or not) that I can call to get
this info?
> Till then, try with mainline.
Unfortunately, I can't. I could move my personal configuration to use GCC
CVS, but I can't force all of our users to do so. I'd like to make this
generally available (it is now, it's just that the numbers aren't really
right), so even if it requires GCC 3.2 specific hacks, I'd like to make it
work. To compound this, I'd like to make it work on x86 and Solaris, but
at least are running GCC 3.2. :)
If there is absolutely no hope, of course, I will give up... but the pool
allocator has got to have some way to find out how much memory is "free"
in it's pools. :)
Thanks again for all the help,
-Chris
--
http://llvm.cs.uiuc.edu/
http://www.nondot.org/~sabre/Projects/