]> git.ipfire.org Git - thirdparty/squid.git/blame - src/mem/forward.h
Maintenance: bump astyle to 2.04 and quieten report
[thirdparty/squid.git] / src / mem / forward.h
CommitLineData
528b2c61 1/*
bbc27441 2 * Copyright (C) 1996-2014 The Squid Software Foundation and contributors
528b2c61 3 *
bbc27441
AJ
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.
528b2c61 7 */
bbc27441
AJ
8
9/* DEBUG: section 13 High Level Memory Pool Management */
10
ed6e9fb9
AJ
11#ifndef _SQUID_SRC_MEM_FORWARD_H
12#define _SQUID_SRC_MEM_FORWARD_H
528b2c61 13
ed6e9fb9 14#include "mem/AllocatorProxy.h"
8a89c28f
FC
15/* for FREE */
16#include "typedefs.h"
17
427854fb 18#include <iosfwd>
27e059d4 19
e1f7507e
AJ
20class StoreEntry;
21class MemPoolStats;
22class MemPoolMeter;
62ee09ca 23
ed6e9fb9 24namespace Mem
62e76326 25{
ed6e9fb9
AJ
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 &);
528b2c61 32};
33
43d1bbe4
FC
34extern const size_t squidSystemPageSize;
35
169a73ce
AJ
36/// Types of memory pool which do not yet use MEMPROXY_CLASS() API
37typedef 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
8a648e8d
FC
70void memClean(void);
71void memInitModule(void);
72void memCleanModule(void);
73void memConfigure(void);
74void *memAllocate(mem_type);
75void *memAllocString(size_t net_size, size_t * gross_size);
76void *memAllocBuf(size_t net_size, size_t * gross_size);
77void *memReallocBuf(void *buf, size_t net_size, size_t * gross_size);
78void memFree(void *, int type);
79void memFreeString(size_t size, void *);
80void memFreeBuf(size_t size, void *);
81FREE *memFreeBufFunc(size_t size);
82int memInUse(mem_type);
3b08e399 83void memDataInit(mem_type, const char *, size_t, int, bool doZero = true);
8a648e8d 84void memCheckInit(void);
8a89c28f 85
ed6e9fb9 86#endif /* _SQUID_SRC_MEM_FORWARD_H */