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 /fnet | |
parent | 1ab845031009400d8222f2c4affffaeaba3ccd71 (diff) |
Remove the XXXFactory indirection. Just use static method on Alloc.
Diffstat (limited to 'fnet')
-rw-r--r-- | fnet/src/vespa/fnet/databuffer.cpp | 8 | ||||
-rw-r--r-- | fnet/src/vespa/fnet/frt/values.h | 9 |
2 files changed, 8 insertions, 9 deletions
diff --git a/fnet/src/vespa/fnet/databuffer.cpp b/fnet/src/vespa/fnet/databuffer.cpp index 913196d6e72..578faba1e49 100644 --- a/fnet/src/vespa/fnet/databuffer.cpp +++ b/fnet/src/vespa/fnet/databuffer.cpp @@ -3,8 +3,6 @@ #include <vespa/fastos/fastos.h> #include <vespa/fnet/fnet.h> -using vespalib::DefaultAlloc; - FNET_DataBuffer::FNET_DataBuffer(uint32_t len) : _bufstart(NULL), _bufend(NULL), @@ -15,7 +13,7 @@ FNET_DataBuffer::FNET_DataBuffer(uint32_t len) len = 256; if (len > 0) { - DefaultAlloc::create(len).swap(_ownedBuf); + Alloc::alloc(len).swap(_ownedBuf); memset(_ownedBuf.get(), 0x55, len); _bufstart = static_cast<char *>(_ownedBuf.get()); assert(_bufstart != NULL); @@ -72,7 +70,7 @@ FNET_DataBuffer::Shrink(uint32_t newsize) return false; } - Alloc newBuf(DefaultAlloc::create(newsize)); + Alloc newBuf(Alloc::alloc(newsize)); memset(newBuf.get(), 0x55, newsize); memcpy(newBuf.get(), _datapt, GetDataLen()); _ownedBuf.swap(newBuf); @@ -97,7 +95,7 @@ FNET_DataBuffer::Pack(uint32_t needbytes) while (bufsize - GetDataLen() < needbytes) bufsize *= 2; - Alloc newBuf(DefaultAlloc::create(bufsize)); + Alloc newBuf(Alloc::alloc(bufsize)); memset(newBuf.get(), 0x55, bufsize); memcpy(newBuf.get(), _datapt, GetDataLen()); _ownedBuf.swap(newBuf); diff --git a/fnet/src/vespa/fnet/frt/values.h b/fnet/src/vespa/fnet/frt/values.h index 8ab8914d31f..7e889466941 100644 --- a/fnet/src/vespa/fnet/frt/values.h +++ b/fnet/src/vespa/fnet/frt/values.h @@ -71,13 +71,14 @@ class FRT_Values public: class LocalBlob : public FRT_ISharedBlob { + using Alloc = vespalib::alloc::Alloc; public: - LocalBlob(vespalib::alloc::Alloc data, uint32_t len) : + LocalBlob(Alloc data, uint32_t len) : _data(std::move(data)), _len(len) { } LocalBlob(const char *data, uint32_t len) : - _data(vespalib::DefaultAlloc::create(len)), + _data(Alloc::alloc(len)), _len(len) { if (data != NULL) { @@ -85,7 +86,7 @@ public: } } void addRef() override {} - void subRef() override { vespalib::alloc::Alloc().swap(_data); } + void subRef() override { Alloc().swap(_data); } uint32_t getLen() override { return _len; } const char *getData() override { return static_cast<const char *>(_data.get()); } char *getInternalData() { return static_cast<char *>(_data.get()); } @@ -93,7 +94,7 @@ public: LocalBlob(const LocalBlob &); LocalBlob &operator=(const LocalBlob &); - vespalib::alloc::Alloc _data; + Alloc _data; uint32_t _len; }; |