diff options
author | Arne H Juul <arnej27959@users.noreply.github.com> | 2017-04-24 12:10:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-24 12:10:42 +0200 |
commit | 9ff4bdb407ed8d855a3f86a17c99906ff738177b (patch) | |
tree | fc2b050224d7dde92d57e1f9cac12c1e5aaf6b90 /vespamalloc | |
parent | 32ae190acc9ac5081049e1c7008d1602c68cf821 (diff) |
Revert "Balder/enforce override 2"
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, 36 insertions, 17 deletions
diff --git a/vespamalloc/src/tests/allocfree/allocfree.cpp b/vespamalloc/src/tests/allocfree/allocfree.cpp index 0806d3a8453..cdb471e35d2 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: - void consume(void * p) override { free(p); } + virtual void consume(void * p) override { free(p); } }; //----------------------------------------------------------------------------- @@ -30,7 +30,7 @@ public: : Producer(cnt, target), _size(size) {} private: uint32_t _size; - void * produce() override { return malloc(_size); } + virtual void * produce() override { return malloc(_size); } }; //----------------------------------------------------------------------------- @@ -41,9 +41,8 @@ public: : ProducerConsumer(cnt, inverse), _size(size) { } private: uint32_t _size; - - void * produce() override { return malloc(_size); } - void consume(void * p) override { free(p); } + virtual void * produce() override { return malloc(_size); } + virtual void consume(void * p) override { free(p); } }; //----------------------------------------------------------------------------- diff --git a/vespamalloc/src/tests/allocfree/linklist.cpp b/vespamalloc/src/tests/allocfree/linklist.cpp index ff33fca4661..06acfa8df8a 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; - void consume(void * p) override { + virtual 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; - void * produce() override { + virtual 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; - void * produce() override { + virtual void * produce() override { void *p = List::linkOut(_head); List *l((List *)p); if ( !((l >= &globalList[0]) && (l < &globalList[NumBlocks]))) { abort(); } return p; } - void consume(void * p) override { + virtual 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 2811da01c09..3237339fb97 100644 --- a/vespamalloc/src/tests/doubledelete/expectsignal.cpp +++ b/vespamalloc/src/tests/doubledelete/expectsignal.cpp @@ -9,8 +9,7 @@ class Test : public TestApp public: int Main() override; private: - bool useProcessStarter() const override { return true; } - + virtual bool useProcessStarter() const override { return true; } }; int Test::Main() diff --git a/vespamalloc/src/tests/test.cpp b/vespamalloc/src/tests/test.cpp index 960114b1bc1..9f5bd826a6b 100644 --- a/vespamalloc/src/tests/test.cpp +++ b/vespamalloc/src/tests/test.cpp @@ -1,5 +1,6 @@ // 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 acfefceee15..8f366acea3a 100644 --- a/vespamalloc/src/tests/thread/racemanythreads.cpp +++ b/vespamalloc/src/tests/thread/racemanythreads.cpp @@ -1,7 +1,17 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - -#include <vespa/vespalib/testkit/testapp.h> +#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"); using namespace vespalib; diff --git a/vespamalloc/src/tests/thread/thread.cpp b/vespamalloc/src/tests/thread/thread.cpp index 9053a435d11..6261a0f8eb6 100644 --- a/vespamalloc/src/tests/thread/thread.cpp +++ b/vespamalloc/src/tests/thread/thread.cpp @@ -1,7 +1,17 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - -#include <vespa/vespalib/testkit/testapp.h> +#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"); using namespace vespalib; @@ -11,7 +21,7 @@ public: ~Test(); int Main() override; private: - bool useIPCHelper() const override { return true; } + virtual bool useIPCHelper() const override { return true; } }; Test::~Test() |