Skip to content

Commit

Permalink
Merge pull request #314 from LaurensVoerman/notify2
Browse files Browse the repository at this point in the history
reduce the need to reallocate the std::ostream buffer behind osg::Notify
  • Loading branch information
OpenSceneGraph git repository committed Aug 23, 2017
2 parents bb3b699 + 682730f commit 90e27d3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/osg/Notify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ struct NotifyStreamBuffer : public std::stringbuf
{
NotifyStreamBuffer() : _severity(osg::NOTICE)
{
/* reduce the need to reallocate the std::ostream buffer behind osg::Notify (causing multitreading issues) by pre-allocating 4095 bytes */
str(std::string(4095, 0));
pubseekpos(0, std::ios_base::out);
}

void setNotifyHandler(osg::NotifyHandler *handler) { _handler = handler; }
Expand Down

0 comments on commit 90e27d3

Please sign in to comment.