Set and check allocator pointer for all cv::Mat instances#25979
Merged
asmorkalov merged 1 commit intoopencv:4.xfrom Aug 5, 2024
Merged
Set and check allocator pointer for all cv::Mat instances#25979asmorkalov merged 1 commit intoopencv:4.xfrom
asmorkalov merged 1 commit intoopencv:4.xfrom
Conversation
87eb3ca to
13c17a2
Compare
Contributor
Author
|
@opencv-alalek I added check for ROI and deallocate counters to check leaks. |
Contributor
opencv-alalek
left a comment
There was a problem hiding this comment.
There is more to check: https://github.com/opencv/opencv/blob/4.10.0/modules/core/include/opencv2/core/mat.hpp#L568-L569
| { | ||
| u = a->allocate(dims, size, _type, 0, step.p, ACCESS_RW /* ignored */, USAGE_DEFAULT); | ||
| CV_Assert(u != 0); | ||
| allocator = a; |
Contributor
There was a problem hiding this comment.
umatrix.cpp has the similar code related to Mat (besides of tons of code related to UMat): https://github.com/opencv/opencv/blob/4.10.0/modules/core/src/umatrix.cpp#L601
Contributor
Author
There was a problem hiding this comment.
UMat handles allocators a bit different. I propose to handle it with dedicated PR. Need to discuss it first.
13c17a2 to
a15cd4b
Compare
opencv-alalek
approved these changes
Aug 5, 2024
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Current implementation does not initialize cv::Mat::allocator filed even, if non standard allocator is used globally.
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.