diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2016-10-16 19:47:08 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2016-10-16 19:47:08 +0000 |
commit | 3dc92c36aa6f58a2ce2f57089501364dab6a44bc (patch) | |
tree | d48b2ca1cee14621dd7c51e3a6ba089ca18e43fe /staging_vespalib | |
parent | 1ab845031009400d8222f2c4affffaeaba3ccd71 (diff) |
Remove the XXXFactory indirection. Just use static method on Alloc.
Diffstat (limited to 'staging_vespalib')
3 files changed, 7 insertions, 7 deletions
diff --git a/staging_vespalib/src/tests/memorydatastore/memorydatastore.cpp b/staging_vespalib/src/tests/memorydatastore/memorydatastore.cpp index 57a18fc5573..7c985afa6a5 100644 --- a/staging_vespalib/src/tests/memorydatastore/memorydatastore.cpp +++ b/staging_vespalib/src/tests/memorydatastore/memorydatastore.cpp @@ -21,7 +21,7 @@ public: void MemoryDataStoreTest::testMemoryDataStore() { - MemoryDataStore s(DefaultAlloc::create(256)); + MemoryDataStore s(Alloc::alloc(256)); std::vector<MemoryDataStore::Reference> v; v.push_back(s.push_back("mumbo", 5)); for (size_t i(0); i < 50; i++) { diff --git a/staging_vespalib/src/vespa/vespalib/data/databuffer.h b/staging_vespalib/src/vespa/vespalib/data/databuffer.h index 53e9e54d0f5..a9ed53e2f84 100644 --- a/staging_vespalib/src/vespa/vespalib/data/databuffer.h +++ b/staging_vespalib/src/vespa/vespalib/data/databuffer.h @@ -33,7 +33,7 @@ namespace vespalib { class DataBuffer { private: - using Alloc = vespalib::alloc::Alloc; + using Alloc = alloc::Alloc; size_t _alignment; char *_externalBuf; char *_bufstart; @@ -53,7 +53,7 @@ public: * @param len the initial size of the buffer. * @param alignment required memory alignment for data start **/ - DataBuffer(size_t len = 1024, size_t alignment = 1, const Alloc & initial = vespalib::DefaultAlloc::create(0)); + DataBuffer(size_t len = 1024, size_t alignment = 1, const Alloc & initial = Alloc::alloc(0)); /** * Construct a databuffer using externally allocated memory. Note @@ -70,7 +70,7 @@ public: _bufend(buf + len), _datapt(_bufstart), _freept(_bufstart), - _buffer(vespalib::DefaultAlloc::create(0)) + _buffer(Alloc::alloc(0)) { } DataBuffer(const char *buf, size_t len) : @@ -80,7 +80,7 @@ public: _bufend(_bufstart + len), _datapt(_bufstart), _freept(_bufend), - _buffer(vespalib::DefaultAlloc::create(0)) + _buffer(Alloc::alloc(0)) { } /** diff --git a/staging_vespalib/src/vespa/vespalib/util/growablebytebuffer.cpp b/staging_vespalib/src/vespa/vespalib/util/growablebytebuffer.cpp index b17accddc5d..abd5e7a2b5b 100644 --- a/staging_vespalib/src/vespa/vespalib/util/growablebytebuffer.cpp +++ b/staging_vespalib/src/vespa/vespalib/util/growablebytebuffer.cpp @@ -5,7 +5,7 @@ using namespace vespalib; GrowableByteBuffer::GrowableByteBuffer(uint32_t initialLen) : - _buffer(DefaultAlloc::create(initialLen)), + _buffer(Alloc::alloc(initialLen)), _position(0) { } @@ -16,7 +16,7 @@ GrowableByteBuffer::allocate(uint32_t len) size_t need(_position + len); if (need > _buffer.size()) { uint32_t newSize = vespalib::roundUp2inN(need); - Alloc newBuf(DefaultAlloc::create(newSize)); + Alloc newBuf(Alloc::alloc(newSize)); memcpy(newBuf.get(), _buffer.get(), _position); _buffer.swap(newBuf); } |