From: Mukund Sivaraman Date: Thu, 12 Jul 2012 04:36:39 +0000 (+0530) Subject: [2088] Mark virtual methods as virtual even in derived classes X-Git-Tag: trac2351_base~188^2^2~7 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fb9bdb9bd4f34364475ca1d0472ce0975affec73;p=thirdparty%2Fkea.git [2088] Mark virtual methods as virtual even in derived classes --- diff --git a/src/lib/util/memory_segment_local.h b/src/lib/util/memory_segment_local.h index 37af0687b8..6764e5b7e5 100644 --- a/src/lib/util/memory_segment_local.h +++ b/src/lib/util/memory_segment_local.h @@ -41,7 +41,7 @@ public: /// /// \param size The size of the memory requested in bytes. /// \return Returns pointer to the memory allocated. - void* allocate(size_t size); + virtual void* allocate(size_t size); /// \brief Free/release a segment of memory. /// @@ -49,13 +49,13 @@ public: /// should be equal to a value returned by allocate(). /// \param size The size of the memory to be freed in bytes. This /// should be equal to the number of bytes originally allocated. - void deallocate(void* ptr, size_t size); + virtual void deallocate(void* ptr, size_t size); /// \brief Check if all allocated memory was deallocated. /// /// \return Returns true if all allocated memory was /// deallocated, false otherwise. - bool allMemoryDeallocated() const; + virtual bool allMemoryDeallocated() const; private: // allocated_size_ can underflow, wrap around to max size_t (which