Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
88e66697
Commit
88e66697
authored
Jul 09, 2015
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
t-api: try to fix allocator fallback code paths
issue:
http://code.opencv.org/issues/4461
parent
ff90f273
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
2 deletions
+18
-2
umatrix.cpp
modules/core/src/umatrix.cpp
+18
-2
No files found.
modules/core/src/umatrix.cpp
View file @
88e66697
...
...
@@ -230,7 +230,20 @@ UMat Mat::getUMat(int accessFlags, UMatUsageFlags usageFlags) const
temp_u
=
a
->
allocate
(
dims
,
size
.
p
,
type
(),
data
,
step
.
p
,
accessFlags
,
usageFlags
);
temp_u
->
refcount
=
1
;
}
UMat
::
getStdAllocator
()
->
allocate
(
temp_u
,
accessFlags
,
usageFlags
);
// TODO result is not checked
bool
allocated
=
false
;
try
{
allocated
=
UMat
::
getStdAllocator
()
->
allocate
(
temp_u
,
accessFlags
,
usageFlags
);
}
catch
(
const
cv
::
Exception
&
e
)
{
fprintf
(
stderr
,
"Exception: %s
\n
"
,
e
.
what
());
}
if
(
!
allocated
)
{
allocated
=
getStdAllocator
()
->
allocate
(
temp_u
,
accessFlags
,
usageFlags
);
CV_Assert
(
allocated
);
}
hdr
.
flags
=
flags
;
setSize
(
hdr
,
dims
,
size
.
p
,
step
.
p
);
finalizeHdr
(
hdr
);
...
...
@@ -269,8 +282,11 @@ void UMat::create(int d, const int* _sizes, int _type, UMatUsageFlags _usageFlag
if
(
total
()
>
0
)
{
MatAllocator
*
a
=
allocator
,
*
a0
=
getStdAllocator
();
if
(
!
a
)
if
(
!
a
)
{
a
=
a0
;
a0
=
Mat
::
getStdAllocator
();
}
try
{
u
=
a
->
allocate
(
dims
,
size
,
_type
,
0
,
step
.
p
,
0
,
usageFlags
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment