Squid Web Cache master
Loading...
Searching...
No Matches
PoolMalloc.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2025 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#ifndef SQUID_SRC_MEM_POOLMALLOC_H
10#define SQUID_SRC_MEM_POOLMALLOC_H
11
31#include "mem/Allocator.h"
32
33#include <stack>
34
37{
38public:
39 MemPoolMalloc(char const *label, size_t aSize);
40 ~MemPoolMalloc() override;
41
42 /* Mem::Allocator API */
43 size_t getStats(Mem::PoolStats &) override;
44 bool idleTrigger(int) const override;
45 void clean(time_t) override;
46
47protected:
48 /* Mem::Allocator API */
49 void *allocate() override;
50 void deallocate(void *) override;
51
52private:
53 std::stack<void *> freelist;
54};
55
56#endif /* SQUID_SRC_MEM_POOLMALLOC_H */
57
bool idleTrigger(int) const override
Definition PoolMalloc.cc:96
void * allocate() override
*alloc()
Definition PoolMalloc.cc:24
~MemPoolMalloc() override
Definition PoolMalloc.cc:89
void deallocate(void *) override
freeOne(void *)
Definition PoolMalloc.cc:50
std::stack< void * > freelist
Definition PoolMalloc.h:53
void clean(time_t) override
size_t getStats(Mem::PoolStats &) override
Definition PoolMalloc.cc:67
const char * label
brief description of objects returned by alloc()
Definition Allocator.h:109