fix the codegen memory leak
This commit is contained in:
@ -1036,7 +1036,8 @@ void CodeGenThreadInitialize()
|
||||
|
||||
bool CodeGenThreadObjectReady()
|
||||
{
|
||||
return t_thrd.codegen_cxt.thr_codegen_obj != NULL && !t_thrd.codegen_cxt.g_runningInFmgr;
|
||||
return t_thrd.codegen_cxt.thr_codegen_obj != NULL && !t_thrd.codegen_cxt.g_runningInFmgr
|
||||
&& !((dorado::GsCodeGen*)t_thrd.codegen_cxt.thr_codegen_obj)->IsCompiled();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -787,7 +787,8 @@ void standard_ExecutorEnd(QueryDesc *queryDesc)
|
||||
UnregisterSnapshot(estate->es_crosscheck_snapshot);
|
||||
|
||||
#ifdef ENABLE_LLVM_COMPILE
|
||||
if (!t_thrd.codegen_cxt.g_runningInFmgr) {
|
||||
/* Do not release codegen in Fmgr and Procedure */
|
||||
if (!t_thrd.codegen_cxt.g_runningInFmgr && u_sess->SPI_cxt._connected == -1) {
|
||||
CodeGenThreadTearDown();
|
||||
}
|
||||
#endif
|
||||
@ -3826,4 +3827,4 @@ TupleTableSlot* FetchPlanSlot(PlanState* subPlanState, ProjectionInfo** projInfo
|
||||
} else {
|
||||
return ExecProcNode(subPlanState);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -539,6 +539,14 @@ public:
|
||||
m_currentModule = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* @Description : Get m_moduleCompiled.
|
||||
*/
|
||||
inline bool IsCompiled()
|
||||
{
|
||||
return m_moduleCompiled;
|
||||
}
|
||||
|
||||
/*
|
||||
* @Description : IR compile to machine code.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user