/*
- * Copyright (C) 1996-2015 The Squid Software Foundation and contributors
+ * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
*
* Squid software is distributed under GPLv2+ license and includes
* contributions from numerous individuals and organizations.
#define _SQUID_SRC_MEM_FORWARD_H
#include "mem/AllocatorProxy.h"
-/* for FREE */
-#include "typedefs.h"
#include <iosfwd>
class StoreEntry;
-class MemPoolStats;
-class MemPoolMeter;
+/// Memory Management
namespace Mem
{
+class Meter;
+class PoolMeter;
+class PoolStats;
+
void Init();
-void Report();
void Stats(StoreEntry *);
void CleanIdlePools(void *unused);
void Report(std::ostream &);
-void PoolReport(const MemPoolStats * mp_st, const MemPoolMeter * AllMeter, std::ostream &);
+void PoolReport(const PoolStats *, const PoolMeter *, std::ostream &);
};
extern const size_t squidSystemPageSize;
+/// \deprecated use MEMPROXY_CLASS instead.
+typedef void FREE(void *);
+
/// Types of memory pool which do not yet use MEMPROXY_CLASS() API
typedef enum {
MEM_NONE,
MEM_16K_BUF,
MEM_32K_BUF,
MEM_64K_BUF,
- MEM_ACL_DENY_INFO_LIST,
- MEM_ACL_NAME_LIST,
-#if USE_CACHE_DIGESTS
- MEM_CACHE_DIGEST,
-#endif
- MEM_CLIENT_INFO,
- MEM_LINK_LIST,
- MEM_DLINK_NODE,
MEM_DREAD_CTRL,
MEM_DWRITE_Q,
- MEM_HTTP_HDR_CONTENT_RANGE,
MEM_MD5_DIGEST,
- MEM_NETDBENTRY,
- MEM_NET_DB_NAME,
- // IMPORTANT: leave this here. pools above are initialized early with memInit()
- MEM_DONTFREE,
- // following pools are initialized late by their component if needed (or never)
- MEM_FQDNCACHE_ENTRY,
- MEM_FWD_SERVER,
- MEM_IDNS_QUERY,
- MEM_IPCACHE_ENTRY,
MEM_MAX
} mem_type;
+/// Main cleanup handler.
void memClean(void);
void memInitModule(void);
void memCleanModule(void);
void memConfigure(void);
+/// Allocate one element from the typed pool
void *memAllocate(mem_type);
void *memAllocString(size_t net_size, size_t * gross_size);
void *memAllocBuf(size_t net_size, size_t * gross_size);
+void *memAllocRigid(size_t net_size);
void *memReallocBuf(void *buf, size_t net_size, size_t * gross_size);
+/// Free a element allocated by memAllocate()
void memFree(void *, int type);
void memFreeString(size_t size, void *);
void memFreeBuf(size_t size, void *);
+void memFreeRigid(void *, size_t net_size);
FREE *memFreeBufFunc(size_t size);
int memInUse(mem_type);
void memDataInit(mem_type, const char *, size_t, int, bool doZero = true);
void memCheckInit(void);
+size_t memStringCount();
#endif /* _SQUID_SRC_MEM_FORWARD_H */