Re: [HACKERS] Concern about memory management with SRFs

2002-08-28 Thread Tom Lane
Joe Conway <[EMAIL PROTECTED]> writes: > Is it OK to use fcinfo->flinfo->fn_mcxt as the long term memory > context or is there a better choice? That is the correct choice. > Is funcctx->multi_call_memory_ctx a > suitable name in place of funcctx->fmctx? No objection here.

Re: [HACKERS] Concern about memory management with SRFs

2002-08-28 Thread Joe Conway
Tom Lane wrote: > I thought about that and didn't like it; it may simplify the simple case > but I think it actively gets in the way of less-simple cases. For > example, the FIRSTCALL code might generate some transient structures > along with ones that it wants to keep. Also, your recommended >

Re: [HACKERS] Concern about memory management with SRFs

2002-08-28 Thread Tom Lane
Joe Conway <[EMAIL PROTECTED]> writes: > Maybe SRF_FIRSTCALL_INIT()(init_MultiFuncCall()) should: > - save CurrentMemoryContext to funcctx->per_call_memory_ctx >(new member of the struct) > - save fcinfo->flinfo->fn_mcxt to funcctx->multi_call_memory_ctx >(nee funcctx->fmctx) > - leave fci

Re: [HACKERS] Concern about memory management with SRFs

2002-08-28 Thread Joe Conway
Tom Lane wrote: > I think we should document that any memory that is allocated in the > first call for use in subsequent calls must come from the memory context > saved in FuncCallContext (and let's choose a more meaningful name than > fmctx, please). This would mean adding code like > > o