From 22bf40ab1e0e3579ef0b48a7cb54deac617d577f Mon Sep 17 00:00:00 2001 From: Derek Nelson <=> Date: Thu, 3 Nov 2016 11:55:47 -0700 Subject: [PATCH] Use less memory --- src/backend/utils/adt/arrayfuncs.c | 2 +- src/backend/utils/adt/json.c | 2 +- src/backend/utils/adt/jsonb.c | 2 +- src/backend/utils/adt/numeric.c | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/backend/utils/adt/arrayfuncs.c b/src/backend/utils/adt/arrayfuncs.c index d3448376b..8cc55f414 100644 --- a/src/backend/utils/adt/arrayfuncs.c +++ b/src/backend/utils/adt/arrayfuncs.c @@ -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(); diff --git a/src/backend/utils/adt/json.c b/src/backend/utils/adt/json.c index cb68cbab1..44281f226 100644 --- a/src/backend/utils/adt/json.c +++ b/src/backend/utils/adt/json.c @@ -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); diff --git a/src/backend/utils/adt/jsonb.c b/src/backend/utils/adt/jsonb.c index da271e77a..4214e8e8f 100644 --- a/src/backend/utils/adt/jsonb.c +++ b/src/backend/utils/adt/jsonb.c @@ -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); diff --git a/src/backend/utils/adt/numeric.c b/src/backend/utils/adt/numeric.c index 6084306d7..989c26110 100644 --- a/src/backend/utils/adt/numeric.c +++ b/src/backend/utils/adt/numeric.c @@ -7727,7 +7727,7 @@ numaggstaterecv(PG_FUNCTION_ARGS) int i; if (!AggCheckCallContext(fcinfo, &context)) - context = fcinfo->flinfo->fn_mcxt; + context = CurrentMemoryContext; old = MemoryContextSwitchTo(context); @@ -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));