Skip to content

core: update handling of allocator stats type#19023

Merged
opencv-pushbot merged 1 commit intoopencv:3.4from
alalek:core_update_allocator_stats_type
Dec 7, 2020
Merged

core: update handling of allocator stats type#19023
opencv-pushbot merged 1 commit intoopencv:3.4from
alalek:core_update_allocator_stats_type

Conversation

@alalek
Copy link
Copy Markdown
Member

@alalek alalek commented Dec 5, 2020

relates #16786

- don't use OPENCV_ALLOCATOR_STATS_COUNTER_TYPE definition in non C++11 builds
- don't use with MinGW
@asmorkalov asmorkalov requested a review from vpisarev December 7, 2020 10:34
@alalek
Copy link
Copy Markdown
Member Author

alalek commented Dec 7, 2020

@berak Could you please check build process in MinGW environment?

@berak
Copy link
Copy Markdown
Contributor

berak commented Dec 7, 2020

sure, will do.

what i tried:

git checkout master
git pull upstream master  (calib3d changes and such)
git checkout -b 20_12_07 (new branch to test)
git pull https://github.com/alalek/opencv core_update_allocator_stats_type   (since it isn't merged yet)

delete build/CmakeCache.txt (since i had OPENCV_ENABLE_ALLOCATOR_STATS=OFF  there) (needs to delete more ?)
check core/CmakeLists.txt (yes i have the changes from this pr)
run cmake-gui (basically change *nothing*)
  * found "Consider adding OPENCV_ALLOCATOR_STATS_COUNTER_TYPE=int/int64_t according to your build configuration" in the log  (but it's quite hidden in all the "small print" ;(
  * OPENCV_ENABLE_ALLOCATOR_STATS is still ON
  * OPENCV_ALLOCATOR_STATS_COUNTER_TYPE is not set to anything

mingw32-make -j3 install

and WIN, it built the core module allright ! (without settin a type manually even)

but, in retrospect, this all looks a bit messy to me.

if OPENCV_ALLOCATOR_STATS_COUNTER_TYPE is the final (??) variable evaluated from cmake, do we really need OPENCV_ENABLE_ALLOCATOR_STATS or OPENCV_DISABLE_ALLOCATOR_STATS even ?

maybe it could be as simple as: "if there's no type set, don't use the stats"

@alalek
Copy link
Copy Markdown
Member Author

alalek commented Dec 7, 2020

@berak Thank you!

Initially OPENCV_ALLOCATOR_STATS_COUNTER_TYPE value is defined in C++ code.
Unfortunately it is not enough (macro become over-complicated and extra libraries for linker may be required), so detection is moved to CMake. CMake variable just helps to configure this externally (or force own value).

@alalek
Copy link
Copy Markdown
Member Author

alalek commented Dec 7, 2020

👍

@opencv-pushbot opencv-pushbot merged commit 2c634ee into opencv:3.4 Dec 7, 2020
@alalek alalek mentioned this pull request Dec 9, 2020
@alalek alalek mentioned this pull request Apr 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants