From d3c72e23df6ef1fde8122db589d12d49c8495535 Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Fri, 9 May 2014 11:32:28 +0300 Subject: Avoid some pnstrdup()s when constructing jsonb This speeds up text to jsonb parsing and hstore to jsonb conversions somewhat. --- src/include/utils/jsonapi.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/include/utils/jsonapi.h') diff --git a/src/include/utils/jsonapi.h b/src/include/utils/jsonapi.h index 889364fb30e..df057121a11 100644 --- a/src/include/utils/jsonapi.h +++ b/src/include/utils/jsonapi.h @@ -73,6 +73,10 @@ typedef void (*json_scalar_action) (void *state, char *token, JsonTokenType toke * point, Likewise, semstate can be NULL. Using an all-NULL structure amounts * to doing a pure parse with no side-effects, and is therefore exactly * what the json input routines do. + * + * The 'fname' and 'token' strings passed to these actions are palloc'd. + * They are not free'd or used further by the parser, so the action function + * is free to do what it wishes with them. */ typedef struct JsonSemAction { -- cgit v1.2.3