]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/ipc/mem/PagePool.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / ipc / mem / PagePool.h
index 44a59740ad8201fbd2bee88687d5eb59f91cc08b..bb0f758a381b49367e82dcf2e2cc3aeb4bb8c2c2 100644 (file)
@@ -1,6 +1,9 @@
 /*
- * $Id$
+ * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
  *
+ * Squid software is distributed under GPLv2+ license and includes
+ * contributions from numerous individuals and organizations.
+ * Please see the COPYING and CONTRIBUTORS files for details.
  */
 
 #ifndef SQUID_IPC_MEM_PAGE_POOL_H
 #include "ipc/mem/PageStack.h"
 #include "ipc/mem/Pointer.h"
 
-namespace Ipc {
+namespace Ipc
+{
 
-namespace Mem {
+namespace Mem
+{
 
 /// Atomic container of shared memory pages. Implemented using a collection of
 /// Segments, each with a PageStack index of free pages. All pools must be
 /// created by a single process.
-class PagePool {
+class PagePool
+{
 public:
     typedef Ipc::Mem::Owner<PageStack> Owner;
 
@@ -43,8 +49,9 @@ public:
 
 private:
     Ipc::Mem::Pointer<PageStack> pageIndex; ///< free pages index
+    typedef std::atomic<size_t> Levels_t;
     /// number of shared memory pages used now for each purpose
-    AtomicWord *const theLevels;
+    Levels_t * const theLevels;
     char *const theBuf; ///< pages storage
 };
 
@@ -53,3 +60,4 @@ private:
 } // namespace Ipc
 
 #endif // SQUID_IPC_MEM_PAGE_POOL_H
+