summaryrefslogtreecommitdiff
path: root/indra/llcommon/llerror.h
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2021-05-12 13:37:24 -0400
committerNat Goodspeed <nat@lindenlab.com>2021-05-12 13:37:24 -0400
commit91c20363eee4e1e02435e0ee74867cdb3f6c7136 (patch)
tree6e1cf0e3f427bce409fa12b966f8bfacf70c510d /indra/llcommon/llerror.h
parent5b96ee0e10923a00ddb3836d4dc3c5f912ca4330 (diff)
SL-10297: Get rid of LLError::LLCallStacks::allocateStackBuffer().
Also freeStackBuffer() and all the funky classic-C string management of a big flat buffer divided into exactly 512 128-byte strings. Define StringVector as a std::vector<std::string>, and use that instead. Retain the behavior of clearing the vector if it exceeds 512 entries. This eliminates the LLError::Log::flush(const std::ostringstream&, char*) overload as well, with its baffling mix of std::string and classic-C (e.g. strlen(out.str().c_str()). If we absolutely MUST use a big memory pool for performance reasons, let's use StringVector with allocators.
Diffstat (limited to 'indra/llcommon/llerror.h')
-rw-r--r--indra/llcommon/llerror.h10
1 files changed, 4 insertions, 6 deletions
diff --git a/indra/llcommon/llerror.h b/indra/llcommon/llerror.h
index 51423350e6..d439136ca8 100644
--- a/indra/llcommon/llerror.h
+++ b/indra/llcommon/llerror.h
@@ -29,7 +29,9 @@
#define LL_LLERROR_H
#include <sstream>
+#include <string>
#include <typeinfo>
+#include <vector>
#include "stdtypes.h"
@@ -198,7 +200,6 @@ namespace LLError
{
public:
static bool shouldLog(CallSite&);
- static void flush(const std::ostringstream& out, char* message);
static void flush(const std::ostringstream&, const CallSite&);
static std::string demangle(const char* mangled);
/// classname<TYPE>()
@@ -280,11 +281,8 @@ namespace LLError
class LL_COMMON_API LLCallStacks
{
private:
- static char** sBuffer ;
- static S32 sIndex ;
-
- static void allocateStackBuffer();
- static void freeStackBuffer();
+ typedef std::vector<std::string> StringVector;
+ static StringVector sBuffer ;
public:
static void push(const char* function, const int line) ;