PoolMalloc.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2023 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 _MEM_POOL_MALLOC_H_
10#define _MEM_POOL_MALLOC_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 /* _MEM_POOL_MALLOC_H_ */
57
bool idleTrigger(int) const override
Definition: PoolMalloc.cc:91
void * allocate() override
*alloc()
Definition: PoolMalloc.cc:24
~MemPoolMalloc() override
Definition: PoolMalloc.cc:84
MemPoolMalloc(char const *label, size_t aSize)
Definition: PoolMalloc.cc:79
void deallocate(void *) override
freeOne(void *)
Definition: PoolMalloc.cc:46
std::stack< void * > freelist
Definition: PoolMalloc.h:53
void clean(time_t) override
Definition: PoolMalloc.cc:97
size_t getStats(Mem::PoolStats &) override
Definition: PoolMalloc.cc:62
const char * label
brief description of objects returned by alloc()
Definition: Allocator.h:109

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors