]> git.ipfire.org Git - thirdparty/squid.git/blame - src/ipc/mem/Pages.h
Fixed raw page buffer type.
[thirdparty/squid.git] / src / ipc / mem / Pages.h
CommitLineData
3e0ddf16
AR
1/*
2 * $Id$
3 *
4 */
5
6#ifndef SQUID_IPC_MEM_PAGES_H
7#define SQUID_IPC_MEM_PAGES_H
8
9namespace Ipc {
10
11namespace Mem {
12
13class PageId;
14
15/// initializes and configures shared memory [pools] for all kids
16void Init();
17
18/// attaches this kid to the already configured shared memory [pools]
19void Attach();
20
21
22/* Single page manipulation */
23
24/// sets page ID and returns true unless no free pages are found
25bool GetPage(PageId &page);
26
27/// makes identified page available as a free page to future GetPage() callers
56f8aa50 28void PutPage(PageId &page);
3e0ddf16
AR
29
30/// converts page handler into a temporary writeable shared memory pointer
31void *PagePointer(const PageId &page);
32
33
34/* Limits and statistics */
35
36/// the total number of shared memory bytes that can be in use at any time
37uint64_t Limit();
38
39/// approximate total number of shared memory bytes used now
40uint64_t Level();
41
42/// approximate total number of shared memory bytes we can allocate now
43inline uint64_t Available() { return Limit() - Level(); }
44
45} // namespace Mem
46
47} // namespace Ipc
48
49#endif // SQUID_IPC_MEM_PAGES_H