1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 15:23:05 +04:00

Clarified default allocator interface.

Conflicts:
	modules/core/src/matrix.cpp
This commit is contained in:
Dan Moodie
2015-11-30 15:45:48 -05:00
committed by Dan
parent 5d5cf32e22
commit 4f373a4284
3 changed files with 28 additions and 11 deletions
+5 -5
View File
@@ -94,7 +94,7 @@ UMatData::~UMatData()
// simulate Mat::deallocate
if (u->mapcount != 0)
{
(u->currAllocator ? u->currAllocator : /* TODO allocator ? allocator :*/ Mat::getStdAllocator())->unmap(u);
(u->currAllocator ? u->currAllocator : /* TODO allocator ? allocator :*/ Mat::getDefaultAllocator())->unmap(u);
}
else
{
@@ -144,7 +144,7 @@ MatAllocator* UMat::getStdAllocator()
if( ocl::haveOpenCL() && ocl::useOpenCL() )
return ocl::getOpenCLAllocator();
#endif
return Mat::getStdAllocator();
return Mat::getDefaultAllocator();
}
void swap( UMat& a, UMat& b )
@@ -286,7 +286,7 @@ UMat Mat::getUMat(int accessFlags, UMatUsageFlags usageFlags) const
accessFlags |= ACCESS_RW;
UMatData* new_u = NULL;
{
MatAllocator *a = allocator, *a0 = getStdAllocator();
MatAllocator *a = allocator, *a0 = getDefaultAllocator();
if(!a)
a = a0;
new_u = a->allocate(dims, size.p, type(), data, step.p, accessFlags, usageFlags);
@@ -302,7 +302,7 @@ UMat Mat::getUMat(int accessFlags, UMatUsageFlags usageFlags) const
}
if (!allocated)
{
allocated = getStdAllocator()->allocate(new_u, accessFlags, usageFlags);
allocated = getDefaultAllocator()->allocate(new_u, accessFlags, usageFlags);
CV_Assert(allocated);
}
if (u != NULL)
@@ -358,7 +358,7 @@ void UMat::create(int d, const int* _sizes, int _type, UMatUsageFlags _usageFlag
if (!a)
{
a = a0;
a0 = Mat::getStdAllocator();
a0 = Mat::getDefaultAllocator();
}
try
{