summaryrefslogtreecommitdiff
path: root/src/WrDiskCache.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2013-06-22 01:10:38 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2013-06-22 01:10:38 +0900
commit07d270c87e6f9184aea4ca17eb26e466712e8db2 (patch)
tree2dfbaa2e0d2ad0f38cb73098608f7d67a64320f8 /src/WrDiskCache.cc
parent126a4bde612eb0e6c48cf2f13ebe3eac45cc71a8 (diff)
Require -std=c++11 and use std::shared_ptr instead of SharedHandle
Diffstat (limited to 'src/WrDiskCache.cc')
-rw-r--r--src/WrDiskCache.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/WrDiskCache.cc b/src/WrDiskCache.cc
index cd204ea6..3238a35f 100644
--- a/src/WrDiskCache.cc
+++ b/src/WrDiskCache.cc
@@ -33,6 +33,9 @@
*/
/* copyright --> */
#include "WrDiskCache.h"
+
+#include <cassert>
+
#include "WrDiskCacheEntry.h"
#include "LogFactory.h"
#include "fmt.h"
@@ -63,8 +66,8 @@ bool WrDiskCache::add(WrDiskCacheEntry* ent)
ensureLimit();
return true;
} else {
- A2_LOG_WARN(fmt("Found duplicate cache entry a.{size=%lu,clock=%"PRId64
- "} b{size=%lu,clock=%"PRId64"}",
+ A2_LOG_WARN(fmt("Found duplicate cache entry a.{size=%lu,clock=%" PRId64
+ "} b{size=%lu,clock=%" PRId64 "}",
static_cast<unsigned long>((*rv.first)->getSize()),
(*rv.first)->getLastUpdate(),
static_cast<unsigned long>(ent->getSize()),
@@ -76,7 +79,7 @@ bool WrDiskCache::add(WrDiskCacheEntry* ent)
bool WrDiskCache::remove(WrDiskCacheEntry* ent)
{
if(set_.erase(ent)) {
- A2_LOG_DEBUG(fmt("Removed cache entry size=%lu, clock=%"PRId64,
+ A2_LOG_DEBUG(fmt("Removed cache entry size=%lu, clock=%" PRId64,
static_cast<unsigned long>(ent->getSize()),
ent->getLastUpdate()));
total_ -= ent->getSize();
@@ -91,7 +94,7 @@ bool WrDiskCache::update(WrDiskCacheEntry* ent, ssize_t delta)
if(!set_.erase(ent)) {
return false;
}
- A2_LOG_DEBUG(fmt("Update cache entry size=%lu, delta=%ld, clock=%"PRId64,
+ A2_LOG_DEBUG(fmt("Update cache entry size=%lu, delta=%ld, clock=%" PRId64,
static_cast<unsigned long>(ent->getSize()),
static_cast<long>(delta),
ent->getLastUpdate()));
@@ -113,7 +116,7 @@ void WrDiskCache::ensureLimit()
while(total_ > limit_) {
EntrySet::iterator i = set_.begin();
WrDiskCacheEntry* ent = *i;
- A2_LOG_DEBUG(fmt("Force flush cache entry size=%lu, clock=%"PRId64,
+ A2_LOG_DEBUG(fmt("Force flush cache entry size=%lu, clock=%" PRId64,
static_cast<unsigned long>(ent->getSizeKey()),
ent->getLastUpdate()));
total_ -= ent->getSize();