* Makefile.tpl (configure-target-rda): Depend on $(ALL_GCC_C).
[deliverable/binutils-gdb.git] / mmalloc / mmstats.c
CommitLineData
c906108c
SS
1/* Access the statistics maintained by `mmalloc'.
2 Copyright 1990, 1991, 1992 Free Software Foundation
3
4 Written May 1989 by Mike Haertel.
5 Modified Mar 1992 by Fred Fish. (fnf@cygnus.com)
6
7The GNU C Library is free software; you can redistribute it and/or
8modify it under the terms of the GNU Library General Public License as
9published by the Free Software Foundation; either version 2 of the
10License, or (at your option) any later version.
11
12The GNU C Library is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15Library General Public License for more details.
16
17You should have received a copy of the GNU Library General Public
18License along with the GNU C Library; see the file COPYING.LIB. If
19not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20Boston, MA 02111-1307, USA.
21
22 The author may be reached (Email) at the address mike@ai.mit.edu,
23 or (US mail) as Mike Haertel c/o Free Software Foundation. */
24
25#include "mmprivate.h"
26
27/* FIXME: See the comment in mmprivate.h where struct mstats is defined.
28 None of the internal mmalloc structures should be externally visible
29 outside the library. */
30
31struct mstats
32mmstats (md)
33 PTR md;
34{
35 struct mstats result;
36 struct mdesc *mdp;
37
38 mdp = MD_TO_MDP (md);
39 result.bytes_total =
40 (char *) mdp -> morecore (mdp, 0) - mdp -> heapbase;
41 result.chunks_used = mdp -> heapstats.chunks_used;
42 result.bytes_used = mdp -> heapstats.bytes_used;
43 result.chunks_free = mdp -> heapstats.chunks_free;
44 result.bytes_free = mdp -> heapstats.bytes_free;
45 return (result);
46}
This page took 0.146632 seconds and 4 git commands to generate.