Skip to content

Commit

Permalink
Use less memory
Browse files Browse the repository at this point in the history
  • Loading branch information
Derek Nelson committed Nov 3, 2016
1 parent cd90136 commit 22bf40a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/backend/utils/adt/arrayfuncs.c
Expand Up @@ -1568,7 +1568,7 @@ arrayaggstaterecv(PG_FUNCTION_ARGS)
MemoryContext context;

if (!AggCheckCallContext(fcinfo, &context))
context = fcinfo->flinfo->fn_mcxt;
context = CurrentMemoryContext;

if (PG_ARGISNULL(0))
PG_RETURN_NULL();
Expand Down
2 changes: 1 addition & 1 deletion src/backend/utils/adt/json.c
Expand Up @@ -2204,7 +2204,7 @@ jsonaggstaterecv(PG_FUNCTION_ARGS)
PG_RETURN_NULL();

if (!AggCheckCallContext(fcinfo, &context))
context = fcinfo->flinfo->fn_mcxt;
context = CurrentMemoryContext;

bytes = PG_GETARG_BYTEA_PP(0);

Expand Down
2 changes: 1 addition & 1 deletion src/backend/utils/adt/jsonb.c
Expand Up @@ -1966,7 +1966,7 @@ jsonbaggstaterecv(PG_FUNCTION_ARGS)
PG_RETURN_NULL();

if (!AggCheckCallContext(fcinfo, &context))
context = fcinfo->flinfo->fn_mcxt;
context = CurrentMemoryContext;

jsonb = PG_GETARG_JSONB(0);

Expand Down
4 changes: 2 additions & 2 deletions src/backend/utils/adt/numeric.c
Expand Up @@ -7727,7 +7727,7 @@ numaggstaterecv(PG_FUNCTION_ARGS)
int i;

if (!AggCheckCallContext(fcinfo, &context))
context = fcinfo->flinfo->fn_mcxt;
context = CurrentMemoryContext;

old = MemoryContextSwitchTo(context);

Expand Down Expand Up @@ -7826,7 +7826,7 @@ numpolyaggstaterecv(PG_FUNCTION_ARGS)
PG_RETURN_NULL();

if (!AggCheckCallContext(fcinfo, &context))
context = fcinfo->flinfo->fn_mcxt;
context = CurrentMemoryContext;

old = MemoryContextSwitchTo(context);
state = (Int128AggState *) VARDATA_ANY(PG_GETARG_ARRAYTYPE_P_COPY(0));
Expand Down

0 comments on commit 22bf40a

Please sign in to comment.