Commit 422e2fc0 by Ian Lance Taylor

runtime: Don't allocate when doing a backtrace.

From-SVN: r195615
parent b5fbde92
......@@ -43,8 +43,14 @@ callback (void *data, uintptr_t pc, const char *filename, int lineno,
loc = &arg->locbuf[arg->index];
loc->pc = pc;
loc->filename = runtime_gostring ((const byte *) filename);
loc->function = runtime_gostring ((const byte *) function);
/* The libbacktrace library says that these strings might disappear,
but with the current implementation they won't. We can't easily
allocate memory here, so for now assume that we can save a
pointer to the strings. */
loc->filename = runtime_gostringnocopy ((const byte *) filename);
loc->function = runtime_gostringnocopy ((const byte *) function);
loc->lineno = lineno;
++arg->index;
return arg->index >= arg->max;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment