diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2017-04-05 02:32:06 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2017-04-23 02:03:47 +0200 |
commit | b57308e4a134fb6139d2cb52a031d3e7185f16cf (patch) | |
tree | 7c31d445e2f76bb737ef90ce29e0e7e6738d6eb1 /vespamalloc | |
parent | 40b8ba5a3f34028d208d4e0dc1b46940d6fe5a47 (diff) |
Use override
Diffstat (limited to 'vespamalloc')
-rw-r--r-- | vespamalloc/src/tests/allocfree/allocfree.cpp | 9 | ||||
-rw-r--r-- | vespamalloc/src/tests/allocfree/linklist.cpp | 8 | ||||
-rw-r--r-- | vespamalloc/src/tests/doubledelete/expectsignal.cpp | 3 | ||||
-rw-r--r-- | vespamalloc/src/tests/test.cpp | 3 | ||||
-rw-r--r-- | vespamalloc/src/tests/thread/racemanythreads.cpp | 14 | ||||
-rw-r--r-- | vespamalloc/src/tests/thread/thread.cpp | 16 |
6 files changed, 17 insertions, 36 deletions
diff --git a/vespamalloc/src/tests/allocfree/allocfree.cpp b/vespamalloc/src/tests/allocfree/allocfree.cpp index cdb471e35d2..0806d3a8453 100644 --- a/vespamalloc/src/tests/allocfree/allocfree.cpp +++ b/vespamalloc/src/tests/allocfree/allocfree.cpp @@ -19,7 +19,7 @@ public: FreeWorker(uint32_t maxQueue, bool inverse) : Consumer (maxQueue, inverse) {} private: - virtual void consume(void * p) override { free(p); } + void consume(void * p) override { free(p); } }; //----------------------------------------------------------------------------- @@ -30,7 +30,7 @@ public: : Producer(cnt, target), _size(size) {} private: uint32_t _size; - virtual void * produce() override { return malloc(_size); } + void * produce() override { return malloc(_size); } }; //----------------------------------------------------------------------------- @@ -41,8 +41,9 @@ public: : ProducerConsumer(cnt, inverse), _size(size) { } private: uint32_t _size; - virtual void * produce() override { return malloc(_size); } - virtual void consume(void * p) override { free(p); } + + void * produce() override { return malloc(_size); } + void consume(void * p) override { free(p); } }; //----------------------------------------------------------------------------- diff --git a/vespamalloc/src/tests/allocfree/linklist.cpp b/vespamalloc/src/tests/allocfree/linklist.cpp index 06acfa8df8a..ff33fca4661 100644 --- a/vespamalloc/src/tests/allocfree/linklist.cpp +++ b/vespamalloc/src/tests/allocfree/linklist.cpp @@ -61,7 +61,7 @@ public: LinkIn(List::AtomicHeadPtr & list, uint32_t maxQueue, bool inverse); private: List::AtomicHeadPtr & _head; - virtual void consume(void * p) override { + void consume(void * p) override { List * l((List *) p); if ( ! ((l >= &globalList[0]) && (l < &globalList[NumBlocks]))) { abort(); } List::linkIn(_head, l, l); @@ -82,7 +82,7 @@ public: : Producer(cnt, target), _head(list) {} private: List::AtomicHeadPtr & _head; - virtual void * produce() override { + void * produce() override { void *p = List::linkOut(_head); List *l((List *)p); if ( ! ((l >= &globalList[0]) && (l < &globalList[NumBlocks]))) { abort(); } @@ -98,13 +98,13 @@ public: : ProducerConsumer(cnt, inverse), _head(list) { } private: List::AtomicHeadPtr & _head; - virtual void * produce() override { + void * produce() override { void *p = List::linkOut(_head); List *l((List *)p); if ( !((l >= &globalList[0]) && (l < &globalList[NumBlocks]))) { abort(); } return p; } - virtual void consume(void * p) override { + void consume(void * p) override { List * l((List *) p); if ( !((l >= &globalList[0]) && (l < &globalList[NumBlocks]))) { abort(); } List::linkIn(_head, l, l); diff --git a/vespamalloc/src/tests/doubledelete/expectsignal.cpp b/vespamalloc/src/tests/doubledelete/expectsignal.cpp index 3237339fb97..2811da01c09 100644 --- a/vespamalloc/src/tests/doubledelete/expectsignal.cpp +++ b/vespamalloc/src/tests/doubledelete/expectsignal.cpp @@ -9,7 +9,8 @@ class Test : public TestApp public: int Main() override; private: - virtual bool useProcessStarter() const override { return true; } + bool useProcessStarter() const override { return true; } + }; int Test::Main() diff --git a/vespamalloc/src/tests/test.cpp b/vespamalloc/src/tests/test.cpp index 9f5bd826a6b..960114b1bc1 100644 --- a/vespamalloc/src/tests/test.cpp +++ b/vespamalloc/src/tests/test.cpp @@ -1,6 +1,5 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <stdio.h> -#include <stdlib.h> + #include <vespa/fastos/thread.h> namespace vespamalloc { diff --git a/vespamalloc/src/tests/thread/racemanythreads.cpp b/vespamalloc/src/tests/thread/racemanythreads.cpp index 8f366acea3a..acfefceee15 100644 --- a/vespamalloc/src/tests/thread/racemanythreads.cpp +++ b/vespamalloc/src/tests/thread/racemanythreads.cpp @@ -1,17 +1,7 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <stdlib.h> -#include <stdio.h> -#include <string.h> -#include <unistd.h> -#include <pthread.h> -#include <stdint.h> -#include <errno.h> -#include <vespa/vespalib/util/atomic.h> -#include <sys/resource.h> -#include <vespa/vespalib/testkit/testapp.h> -#include <vespa/log/log.h> -LOG_SETUP("thread_test"); +#include <vespa/vespalib/testkit/testapp.h> +#include <vespa/vespalib/util/atomic.h> using namespace vespalib; diff --git a/vespamalloc/src/tests/thread/thread.cpp b/vespamalloc/src/tests/thread/thread.cpp index 6261a0f8eb6..9053a435d11 100644 --- a/vespamalloc/src/tests/thread/thread.cpp +++ b/vespamalloc/src/tests/thread/thread.cpp @@ -1,17 +1,7 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <stdlib.h> -#include <stdio.h> -#include <string.h> -#include <unistd.h> -#include <pthread.h> -#include <stdint.h> -#include <errno.h> -#include <vespa/vespalib/util/atomic.h> -#include <sys/resource.h> -#include <vespa/vespalib/testkit/testapp.h> -#include <vespa/log/log.h> -LOG_SETUP("thread_test"); +#include <vespa/vespalib/testkit/testapp.h> +#include <vespa/vespalib/util/atomic.h> using namespace vespalib; @@ -21,7 +11,7 @@ public: ~Test(); int Main() override; private: - virtual bool useIPCHelper() const override { return true; } + bool useIPCHelper() const override { return true; } }; Test::~Test() |