summaryrefslogtreecommitdiffstats
path: root/memfilepersistence
diff options
context:
space:
mode:
authorHaavard <havardpe@yahoo-inc.com>2017-03-28 10:31:20 +0000
committerHaavard <havardpe@yahoo-inc.com>2017-03-28 10:31:20 +0000
commit06eb5aee7257a3001f292b1980fd640e352bef96 (patch)
tree477e1c8861983016775cca9f261582707ea2b328 /memfilepersistence
parentf5dcc5daa1d007c74dc3d50a51cf979d04476b1d (diff)
use make_shared where possible
Diffstat (limited to 'memfilepersistence')
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/mapper/simplememfileiobuffer.cpp4
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/memfile/memfilecache.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/memfilepersistence/src/vespa/memfilepersistence/mapper/simplememfileiobuffer.cpp b/memfilepersistence/src/vespa/memfilepersistence/mapper/simplememfileiobuffer.cpp
index da3b180201e..6e071969218 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/mapper/simplememfileiobuffer.cpp
+++ b/memfilepersistence/src/vespa/memfilepersistence/mapper/simplememfileiobuffer.cpp
@@ -292,7 +292,7 @@ SimpleMemFileIOBuffer::allocateBuffer(DocumentPart part,
// If the requested size is greater than or equal to our working buffer
// size, simply allocate a separate buffer for it.
if (sz >= WORKING_BUFFER_SIZE) {
- return BufferAllocation(SharedBuffer::SP(new SharedBuffer(sz)), 0, sz);
+ return BufferAllocation(std::make_shared<SharedBuffer>(sz), 0, sz);
}
SharedBuffer::SP &bufSP(_workingBuffers[part]);
@@ -308,7 +308,7 @@ SimpleMemFileIOBuffer::allocateBuffer(DocumentPart part,
static_cast<uint32_t>(bufSP->allocate(sz, align)),
sz);
} else {
- SharedBuffer::SP newBuf(new SharedBuffer(WORKING_BUFFER_SIZE));
+ auto newBuf = std::make_shared<SharedBuffer>(WORKING_BUFFER_SIZE);
bufSP = newBuf;
return BufferAllocation(newBuf,
static_cast<uint32_t>(newBuf->allocate(sz, align)),
diff --git a/memfilepersistence/src/vespa/memfilepersistence/memfile/memfilecache.cpp b/memfilepersistence/src/vespa/memfilepersistence/memfile/memfilecache.cpp
index 409789eadcc..efa26605f37 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/memfile/memfilecache.cpp
+++ b/memfilepersistence/src/vespa/memfilepersistence/memfile/memfilecache.cpp
@@ -203,7 +203,7 @@ MemFileCache::get(const BucketId& id, Environment& env, Directory& dir,
// in the common case that there's a bucket file on the disk. The
// content layer shall guarantee that no concurrent operations happen
// for a single bucket, so this should be fully thread safe.
- Entry::SP entry(new Entry(file, env, createIfNotExisting));
+ auto entry = std::make_shared<Entry>(file, env, createIfNotExisting);
vespalib::LockGuard reLock(_cacheLock);
std::pair<LRUCache::iterator, bool> inserted(