reduce the need to reallocate the std::ostream buffer behind osg::Notify (causing multitreading issues) by pre-allocating 4095 bytes.

This commit is contained in:
Laurens Voerman
2017-08-22 15:23:47 +02:00
parent ad98bdd165
commit 682730fbe4

View File

@@ -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; }