/*
- * $Id$
- *
* DEBUG: section 54 Interprocess Communication
*/
#include "squid.h"
-#include "protos.h"
-#include "Store.h"
#include "ipc/StoreMap.h"
+#include "Store.h"
+#include "store_key_md5.h"
+#include "tools.h"
Ipc::StoreMap::Owner *
Ipc::StoreMap::Init(const char *const path, const int limit, const size_t extrasSize)
Ipc::StoreMap::freeLocked(Slot &s, bool keepLocked)
{
if (s.state == Slot::Readable && cleaner)
- cleaner->cleanReadable(&s - shared->slots);
+ cleaner->cleanReadable(&s - shared->slots.raw());
s.waitingToBeFreed = false;
s.state = Slot::Empty;
if (!keepLocked)
s.lock.unlockExclusive();
--shared->count;
- debugs(54, 5, HERE << " freed slot at " << (&s - shared->slots) <<
+ debugs(54, 5, HERE << " freed slot at " << (&s - shared->slots.raw()) <<
" in map [" << path << ']');
}
-
/* Ipc::StoreMapSlot */
Ipc::StoreMapSlot::StoreMapSlot(): state(Empty)
{
- xmemset(&key, 0, sizeof(key));
- xmemset(&basics, 0, sizeof(basics));
+ memset(&key, 0, sizeof(key));
+ memset(&basics, 0, sizeof(basics));
}
void
/* Ipc::StoreMap::Shared */
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()
+ limit(aLimit), extrasSize(anExtrasSize), count(0), slots(aLimit)
{
- delete[] slots;
}
size_t