mirror of
https://github.com/opencv/opencv.git
synced 2025-08-06 14:36:36 +08:00
Merge pull request #11072 from alalek:explicit_autobuffer
This commit is contained in:
commit
1097d0e810
@ -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:
|
|||||||
//! 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);
|
||||||
|
Loading…
Reference in New Issue
Block a user