1 ///-*-C++-*-//////////////////////////////////////////////////////////////////
3 // Hoard: A Fast, Scalable, and Memory-Efficient Allocator
4 // for Shared-Memory Multiprocessors
5 // Contact author: Emery Berger, http://www.cs.utexas.edu/users/emery
7 // Copyright (c) 1998-2000, The University of Texas at Austin.
9 // This library is free software; you can redistribute it and/or modify
10 // it under the terms of the GNU Library General Public License as
11 // published by the Free Software Foundation, http://www.fsf.org.
13 // This library is distributed in the hope that it will be useful, but
14 // WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Library General Public License for more details.
18 //////////////////////////////////////////////////////////////////////////////
38 inline const heapStats
& operator=(const heapStats
& p
);
40 inline void incStats(int updateU
, int updateA
);
41 inline void incUStats(void);
43 inline void decStats(int updateU
, int updateA
);
44 inline void decUStats(void);
45 inline void decUStats(int &Uout
, int &Aout
);
47 inline void getStats(int &Uout
, int &Aout
);
50 inline int getUmax(void);
51 inline int getAmax(void);
55 // U and A *must* be the first items in this class --
56 // we will depend on this to atomically update them.
58 int U
; // Memory in use.
59 int A
; // Memory allocated.
69 heapStats::incStats(int updateU
, int updateA
)
91 heapStats::incUStats(void)
108 heapStats::decStats(int updateU
, int updateA
)
110 assert(updateU
>= 0);
111 assert(updateA
>= 0);
113 assert(U
>= updateU
);
114 assert(A
>= updateA
);
124 heapStats::decUStats(int &Uout
, int &Aout
)
138 heapStats::decUStats(void)
148 heapStats::getStats(int &Uout
, int &Aout
)
162 heapStats::getUmax(void)
169 heapStats::getAmax(void)
175 #endif // _HEAPSTATS_H_