Commit 1097d0e8 authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

Merge pull request #11072 from alalek:explicit_autobuffer

parents 284e5231 ee1ac114
...@@ -472,7 +472,7 @@ class IppAutoBuffer ...@@ -472,7 +472,7 @@ class IppAutoBuffer
{ {
public: public:
IppAutoBuffer() { m_size = 0; m_pBuffer = NULL; } IppAutoBuffer() { m_size = 0; m_pBuffer = NULL; }
IppAutoBuffer(size_t size) { m_size = 0; m_pBuffer = NULL; allocate(size); } explicit IppAutoBuffer(size_t size) { m_size = 0; m_pBuffer = NULL; allocate(size); }
~IppAutoBuffer() { deallocate(); } ~IppAutoBuffer() { deallocate(); }
T* allocate(size_t size) { if(m_size < size) { deallocate(); m_pBuffer = (T*)CV_IPP_MALLOC(size); m_size = size; } return m_pBuffer; } T* allocate(size_t size) { if(m_size < size) { deallocate(); m_pBuffer = (T*)CV_IPP_MALLOC(size); m_size = size; } return m_pBuffer; }
void deallocate() { if(m_pBuffer) { ippFree(m_pBuffer); m_pBuffer = NULL; } m_size = 0; } void deallocate() { if(m_pBuffer) { ippFree(m_pBuffer); m_pBuffer = NULL; } m_size = 0; }
......
...@@ -124,7 +124,7 @@ public: ...@@ -124,7 +124,7 @@ public:
//! the default constructor //! the default constructor
AutoBuffer(); AutoBuffer();
//! constructor taking the real buffer size //! constructor taking the real buffer size
AutoBuffer(size_t _size); explicit AutoBuffer(size_t _size);
//! the copy constructor //! the copy constructor
AutoBuffer(const AutoBuffer<_Tp, fixed_size>& buf); AutoBuffer(const AutoBuffer<_Tp, fixed_size>& buf);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment