]> git.ipfire.org Git - thirdparty/squid.git/blob - src/mem/forward.h
Merged from trunk
[thirdparty/squid.git] / src / mem / forward.h
1 /*
2 * Copyright (C) 1996-2014 The Squid Software Foundation and contributors
3 *
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
7 */
8
9 /* DEBUG: section 13 High Level Memory Pool Management */
10
11 #ifndef _SQUID_SRC_MEM_FORWARD_H
12 #define _SQUID_SRC_MEM_FORWARD_H
13
14 #include "mem/AllocatorProxy.h"
15 /* for FREE */
16 #include "typedefs.h"
17
18 #include <iosfwd>
19
20 class StoreEntry;
21 class MemPoolStats;
22 class MemPoolMeter;
23
24 namespace Mem
25 {
26 void Init();
27 void Report();
28 void Stats(StoreEntry *);
29 void CleanIdlePools(void *unused);
30 void Report(std::ostream &);
31 void PoolReport(const MemPoolStats * mp_st, const MemPoolMeter * AllMeter, std::ostream &);
32 };
33
34 extern const size_t squidSystemPageSize;
35
36 /// Types of memory pool which do not yet use MEMPROXY_CLASS() API
37 typedef enum {
38 MEM_NONE,
39 MEM_2K_BUF,
40 MEM_4K_BUF,
41 MEM_8K_BUF,
42 MEM_16K_BUF,
43 MEM_32K_BUF,
44 MEM_64K_BUF,
45 MEM_ACL_DENY_INFO_LIST,
46 MEM_ACL_NAME_LIST,
47 #if USE_CACHE_DIGESTS
48 MEM_CACHE_DIGEST,
49 #endif
50 MEM_CLIENT_INFO,
51 MEM_LINK_LIST,
52 MEM_DLINK_NODE,
53 MEM_DREAD_CTRL,
54 MEM_DWRITE_Q,
55 MEM_HTTP_HDR_CONTENT_RANGE,
56 MEM_MD5_DIGEST,
57 MEM_NETDBENTRY,
58 MEM_NET_DB_NAME,
59 MEM_RELIST,
60 // IMPORTANT: leave this here. pools above are initialized early with memInit()
61 MEM_DONTFREE,
62 // following pools are initialized late by their component if needed (or never)
63 MEM_FQDNCACHE_ENTRY,
64 MEM_FWD_SERVER,
65 MEM_IDNS_QUERY,
66 MEM_IPCACHE_ENTRY,
67 MEM_MAX
68 } mem_type;
69
70 void memClean(void);
71 void memInitModule(void);
72 void memCleanModule(void);
73 void memConfigure(void);
74 void *memAllocate(mem_type);
75 void *memAllocString(size_t net_size, size_t * gross_size);
76 void *memAllocBuf(size_t net_size, size_t * gross_size);
77 void *memReallocBuf(void *buf, size_t net_size, size_t * gross_size);
78 void memFree(void *, int type);
79 void memFreeString(size_t size, void *);
80 void memFreeBuf(size_t size, void *);
81 FREE *memFreeBufFunc(size_t size);
82 int memInUse(mem_type);
83 void memDataInit(mem_type, const char *, size_t, int, bool doZero = true);
84 void memCheckInit(void);
85
86 #endif /* _SQUID_SRC_MEM_FORWARD_H */
87