]>
Commit | Line | Data |
---|---|---|
528b2c61 | 1 | /* |
528b2c61 | 2 | * DEBUG: section 13 High Level Memory Pool Management |
3 | * AUTHOR: Harvest Derived | |
4 | * | |
5 | * SQUID Web Proxy Cache http://www.squid-cache.org/ | |
6 | * ---------------------------------------------------------- | |
7 | * | |
8 | * Squid is the result of efforts by numerous individuals from | |
9 | * the Internet community; see the CONTRIBUTORS file for full | |
10 | * details. Many organizations have provided support for Squid's | |
11 | * development; see the SPONSORS file for full details. Squid is | |
12 | * Copyrighted (C) 2001 by the Regents of the University of | |
13 | * California; see the COPYRIGHT file for full details. Squid | |
14 | * incorporates software developed and/or copyrighted by other | |
15 | * sources; see the CREDITS file for full details. | |
16 | * | |
17 | * This program is free software; you can redistribute it and/or modify | |
18 | * it under the terms of the GNU General Public License as published by | |
19 | * the Free Software Foundation; either version 2 of the License, or | |
20 | * (at your option) any later version. | |
26ac0430 | 21 | * |
528b2c61 | 22 | * This program is distributed in the hope that it will be useful, |
23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
25 | * GNU General Public License for more details. | |
26ac0430 | 26 | * |
528b2c61 | 27 | * You should have received a copy of the GNU General Public License |
28 | * along with this program; if not, write to the Free Software | |
29 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. | |
30 | * | |
31 | */ | |
528b2c61 | 32 | #ifndef SQUID_MEM |
33 | #define SQUID_MEM | |
34 | ||
8a89c28f FC |
35 | /* for mem_type */ |
36 | #include "enums.h" | |
37 | /* for FREE */ | |
38 | #include "typedefs.h" | |
39 | ||
427854fb | 40 | #include <iosfwd> |
27e059d4 | 41 | |
e1f7507e AJ |
42 | class StoreEntry; |
43 | class MemPoolStats; | |
44 | class MemPoolMeter; | |
62ee09ca | 45 | |
62e76326 | 46 | class Mem |
47 | { | |
48 | ||
528b2c61 | 49 | public: |
62e76326 | 50 | static void Init(); |
97244680 | 51 | static void Report(); |
62e76326 | 52 | static void Stats(StoreEntry *); |
53 | static void CleanIdlePools(void *unused); | |
c21ad0f5 | 54 | static void Report(std::ostream &); |
55 | static void PoolReport(const MemPoolStats * mp_st, const MemPoolMeter * AllMeter, std::ostream &); | |
ea391f18 FC |
56 | |
57 | protected: | |
58 | static void RegisterWithCacheManager(void); | |
528b2c61 | 59 | }; |
60 | ||
43d1bbe4 FC |
61 | extern const size_t squidSystemPageSize; |
62 | ||
8a648e8d FC |
63 | void memClean(void); |
64 | void memInitModule(void); | |
65 | void memCleanModule(void); | |
66 | void memConfigure(void); | |
67 | void *memAllocate(mem_type); | |
68 | void *memAllocString(size_t net_size, size_t * gross_size); | |
69 | void *memAllocBuf(size_t net_size, size_t * gross_size); | |
70 | void *memReallocBuf(void *buf, size_t net_size, size_t * gross_size); | |
71 | void memFree(void *, int type); | |
72 | void memFreeString(size_t size, void *); | |
73 | void memFreeBuf(size_t size, void *); | |
74 | FREE *memFreeBufFunc(size_t size); | |
75 | int memInUse(mem_type); | |
3b08e399 | 76 | void memDataInit(mem_type, const char *, size_t, int, bool doZero = true); |
8a648e8d FC |
77 | void memCheckInit(void); |
78 | void memConfigure(void); | |
8a89c28f | 79 | |
528b2c61 | 80 | #endif /* SQUID_MEM */ |