Commit Graph

14 Commits

Author SHA1 Message Date
jvoisin 3cbf1dc042 First pass with include-what-you-use 2022-10-09 10:39:43 +00:00
clang-format-bot ddb0522bbf
Apply clang-format to code base 2022-09-22 21:35:26 +03:00
elsid 0614b82452
Restore UnrefQueue to destruct animation asynchronously 2022-07-24 21:08:43 +02:00
Bo Svensson a854a6e04a
removes UnrefQueue (#3181)
Currently, we use an `UnrefQueue` which supposedly aims to transfer destruction costs to another thread. The implications of this unusual pattern can not be well understood because some allocators might free resources more efficiently if they are freed by the same thread that allocated them. In addition, `UnrefQueue` complicates the validation of thread safety in our engine. Lastly, our current usage of `UnrefQueue` triggers `ref()`, `unref()` atomic operations as objects are passed into the queue. These operations could be more expensive than the actual destruction.

With this PR we thus remove `UnrefQueue`. We can expect these changes to have a minor impact at most because we free most resources elsewhere in `ResourceSystem::updateCache`.
2021-10-20 23:02:15 +02:00
Andrei Kortunov 065ed5138e Use emplace_back instead of push_back 2020-10-18 10:27:35 +04:00
Sophie Kirschner c412f99963 Remove commented lines in UnrefWorkItem::doWork 2018-08-26 11:08:06 +03:00
Sophie Kirschner 4dd9386c4f Fix error: member access into incomplete type 'SceneUtil::UnrefWorkItem'
Fixes compile error encountered on OSX 10.9 with g++

sophie:build pineapple$ g++ --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix

The compilation error:

[ 24%] Building CXX object apps/openmw/CMakeFiles/openmw.dir/mwrender/renderingmanager.cpp.o
In file included from /Users/pineapple/git/openmw/apps/openmw/mwrender/renderingmanager.cpp:1:
In file included from /Users/pineapple/git/openmw/apps/openmw/mwrender/renderingmanager.hpp:4:
/Users/pineapple/git/openmw/openmw-deps/include/osg/ref_ptr:35:36: error: member access into incomplete type 'SceneUtil::UnrefWorkItem'
        ~ref_ptr() { if (_ptr) _ptr->unref();  _ptr = 0; }
                                   ^
/Users/pineapple/git/openmw/./components/sceneutil/unrefqueue.hpp:14:11: note: in instantiation of member function
      'osg::ref_ptr<SceneUtil::UnrefWorkItem>::~ref_ptr' requested here
    class UnrefQueue : public osg::Referenced
          ^
/Users/pineapple/git/openmw/./components/sceneutil/unrefqueue.hpp:10:11: note: forward declaration of 'SceneUtil::UnrefWorkItem'
    class UnrefWorkItem;
2018-08-24 16:41:52 +03:00
Andrei Kortunov 1452684d9e Use new logging system for components 2018-08-14 19:42:41 +04:00
scrawl 8f79fa3d72 Add resource statistics panel opened with F4 2017-02-22 14:28:45 +01:00
scrawl a1069dce3c Change UnrefQueue to accept osg::Referenced instead of osg::Object 2017-02-04 02:24:42 +01:00
scrawl 2f8be401cc Add the unref work items to the front of the workqueue (Bug #3273)
Ensures that memory still gets freed even if the workqueue is overloaded.
2016-03-29 00:27:56 +02:00
scrawl afe533e670 Accept a const Object in UnrefQueue 2016-02-09 19:00:30 +01:00
scrawl 40a6e05e17 Use a deque instead of vector in UnrefQueue 2016-02-09 16:09:55 +01:00
scrawl d11c2864df Introduce UnrefQueue to handle the deleting of no longer needed objects in the background thread 2016-02-09 15:45:35 +01:00