Changeset: 2c374699cec6 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/2c374699cec6
Modified Files:
monetdb5/mal/mal_profiler.c
Branch: resource_management
Log Message:
use tmp allocator in profiler
diffs (39 lines):
diff --git a/monetdb5/mal/mal_profiler.c b/monetdb5/mal/mal_profiler.c
--- a/monetdb5/mal/mal_profiler.c
+++ b/monetdb5/mal/mal_profiler.c
@@ -232,7 +232,7 @@ prepareNonMalEvent(Client cntxt, enum ev
}
static inline str
-format_val2json(const ValPtr res)
+format_val2json(const Client c, const ValPtr res)
{
char *buf = NULL;
size_t sz = 0;
@@ -267,7 +267,8 @@ format_val2json(const ValPtr res)
ValRecord val;
/* TODO use ta */
- if (VALinit(NULL, &val, TYPE_str, buf) == NULL) {
+ ma_open(c->ta);
+ if (VALinit(c->ta, &val, TYPE_str, buf) == NULL) {
GDKfree(buf);
return NULL;
}
@@ -277,6 +278,7 @@ format_val2json(const ValPtr res)
char *buf2;
buf2 = VALformat(&val);
VALclear(&val);
+ ma_close(c->ta);
return buf2;
}
@@ -503,7 +505,7 @@ prepareMalEvent(Client cntxt, MalBlkPtr
GDKfree(tname);
if (!ok)
goto cleanup_and_exit;
- cv =
format_val2json(&stk->stk[getArg(pci, j)]);
+ cv = format_val2json(cntxt,
&stk->stk[getArg(pci, j)]);
if (cv)
ok = logadd(&logbuf,
",\"value\":%s", cv);
GDKfree(cv);
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]