1 /* Access the statistics maintained by `mmalloc'.
2 Copyright 1990, 1991, 1992 Free Software Foundation
4 Written May 1989 by Mike Haertel.
5 Modified Mar 1992 by Fred Fish. (fnf@cygnus.com) */
7 /* Copyright (c) 2010. The SimGrid Team.
8 * All rights reserved. */
10 /* This program is free software; you can redistribute it and/or modify it
11 * under the terms of the license (GNU LGPL) which comes with this package. */
13 #include "mmprivate.h"
15 /* FIXME: See the comment in mmprivate.h where struct mstats is defined.
16 None of the internal mmalloc structures should be externally visible
17 outside the library. */
19 struct mstats mmstats(void *md)
25 result.bytes_total = (char *) mdp->top - (char *) mdp;
26 result.chunks_used = mdp->heapstats.chunks_used;
27 result.bytes_used = mdp->heapstats.bytes_used;
28 result.chunks_free = mdp->heapstats.chunks_free;
29 result.bytes_free = mdp->heapstats.bytes_free;