clang++ doesn't support c++ variable arrays for non-pod types.
Change variable arrays to dynamically-allocated arrays, Ipc::QueueReaders, Ipc::StoreMap and Ipc::Mem::PageStack
Ipc::QueueReaders::QueueReaders(const int aCapacity): theCapacity(aCapacity)
{
Must(theCapacity > 0);
- new (theReaders) QueueReader[theCapacity];
+ theReaders=new QueueReader[theCapacity];
+}
+
+Ipc::QueueReaders::~QueueReaders()
+{
+ delete[] theReaders;
}
size_t
{
public:
QueueReaders(const int aCapacity);
+ ~QueueReaders();
size_t sharedMemorySize() const;
static size_t SharedMemorySize(const int capacity);
const int theCapacity; /// number of readers
- QueueReader theReaders[]; /// readers
+ QueueReader *theReaders; /// readers
+private:
+ QueueReaders(); //not implemented
+ QueueReaders& operator =(const QueueReaders&); //not implemented
+ QueueReaders(const QueueReaders&); //not implemented
};
/**
Ipc::StoreMap::Shared::Shared(const int aLimit, const size_t anExtrasSize):
limit(aLimit), extrasSize(anExtrasSize), count(0)
{
+ slots=new Slot[limit];
+}
+
+Ipc::StoreMap::Shared::~Shared()
+{
+ delete[] slots;
}
size_t
Shared(const int aLimit, const size_t anExtrasSize);
size_t sharedMemorySize() const;
static size_t SharedMemorySize(const int limit, const size_t anExtrasSize);
+ ~Shared();
const int limit; ///< maximum number of map slots
const size_t extrasSize; ///< size of slot extra data
Atomic::Word count; ///< current number of map slots
- Slot slots[]; ///< slots storage
+ Slot *slots; ///< slots storage
+ private:
+ Shared(); //disabled
+ Shared &operator=(const Shared&); //disabled
+ Shared(const Shared&); //disabled
};
public:
// initially, all pages are free
for (Offset i = 0; i < theSize; ++i)
theItems[i] = i + 1; // skip page number zero to keep numbers positive
+ theItems=new Item[theSize];
+}
+
+Ipc::Mem::PageStack::~PageStack()
+{
+ delete[] theItems;
}
/*
typedef uint32_t Value; ///< stack item type (a free page number)
PageStack(const uint32_t aPoolId, const unsigned int aCapacity, const size_t aPageSize);
+ ~PageStack();
unsigned int capacity() const { return theCapacity; }
size_t pageSize() const { return thePageSize; }
Atomic::WordT<Offset> theFirstWritable;
typedef Atomic::WordT<Value> Item;
- Item theItems[]; ///< page number storage
+ Item *theItems; ///< page number storage
};
} // namespace Mem