]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/ipc/mem/PageStack.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / ipc / mem / PageStack.h
index ddb1ba9ed076a58ac9f4f44e7bf8fe04f12defb0..6e22ade0105fd7c5f6bab64fe7194705ecda7ca6 100644 (file)
@@ -1,12 +1,16 @@
 /*
- * $Id$
+ * Copyright (C) 1996-2015 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_STACK_H
 #define SQUID_IPC_MEM_PAGE_STACK_H
 
 #include "ipc/AtomicWord.h"
+#include "ipc/mem/FlexibleArray.h"
 
 namespace Ipc
 {
@@ -59,15 +63,15 @@ private:
     const Offset theCapacity; ///< stack capacity, i.e. theItems size
     const size_t thePageSize; ///< page size, used to calculate shared memory size
     /// lower bound for the number of free pages (may get negative!)
-    AtomicWordT<Offset> theSize;
+    Atomic::WordT<Offset> theSize;
 
     /// last readable item index; just a hint, not a guarantee
-    AtomicWordT<Offset> theLastReadable;
+    Atomic::WordT<Offset> theLastReadable;
     /// first writable item index; just a hint, not a guarantee
-    AtomicWordT<Offset> theFirstWritable;
+    Atomic::WordT<Offset> theFirstWritable;
 
-    typedef AtomicWordT<Value> Item;
-    Item theItems[]; ///< page number storage
+    typedef Atomic::WordT<Value> Item;
+    Ipc::Mem::FlexibleArray<Item> theItems; ///< page number storage
 };
 
 } // namespace Mem
@@ -75,3 +79,4 @@ private:
 } // namespace Ipc
 
 #endif // SQUID_IPC_MEM_PAGE_STACK_H
+