summaryrefslogtreecommitdiff
path: root/rsScriptC.cpp
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2016-06-15 01:46:48 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2016-06-15 01:46:48 +0000
commite9794ac671fce6370eb180e520ed617afd30b4bc (patch)
tree60cff959c5169fdf1d8936ce494fac2612710ab0 /rsScriptC.cpp
parent8bb6556d2d937308e3042b87661896b2ae2dfc0a (diff)
parentd969fdc55bc82d48242be3c6193a6548137e9579 (diff)
downloadrs-e9794ac671fce6370eb180e520ed617afd30b4bc.tar.gz
Merge "Fix crash in tracing code."
Diffstat (limited to 'rsScriptC.cpp')
-rw-r--r--rsScriptC.cpp16
1 files changed, 5 insertions, 11 deletions
diff --git a/rsScriptC.cpp b/rsScriptC.cpp
index eaef8490..351aa4cd 100644
--- a/rsScriptC.cpp
+++ b/rsScriptC.cpp
@@ -29,6 +29,7 @@
#include <sys/stat.h>
+#include <sstream>
#include <string>
#ifdef USE_MINGW
@@ -192,15 +193,12 @@ void ScriptC::runForEach(Context *rsc,
// Trace this function call.
// To avoid overhead we only build the string if tracing is actually
// enabled.
- String8 *AString = NULL;
- const char *String = "";
+ std::stringstream ss;
if (ATRACE_ENABLED()) {
- AString = new String8("runForEach_");
- AString->append(mHal.info.exportedForeachFuncList[slot].first);
- String = AString->string();
+ ss << "runForEach slot[" << slot << "]";
}
- ATRACE_NAME(String);
- (void)String;
+ ATRACE_NAME(ss.str().c_str());
+
if (mRSC->hadFatalError()) return;
Context::PushState ps(rsc);
@@ -224,10 +222,6 @@ void ScriptC::runForEach(Context *rsc,
rsc->setError(RS_ERROR_FATAL_DRIVER,
"Driver support for multi-input not present");
}
-
- if (AString) {
- delete AString;
- }
}
void ScriptC::runReduce(Context *rsc, uint32_t slot, const Allocation *ain,