File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,7 @@ PyObject *PLy_interp_globals = NULL;
73
73
/* this doesn't need to be global; use PLy_current_execution_context() */
74
74
static PLyExecutionContext * PLy_execution_contexts = NULL ;
75
75
76
+ static MemoryContext PLy_memory_context ;
76
77
77
78
void
78
79
_PG_init (void )
@@ -464,3 +465,14 @@ PLy_pop_execution_context(void)
464
465
MemoryContextDelete (context -> scratch_ctx );
465
466
pfree (context );
466
467
}
468
+
469
+ MemoryContext
470
+ PLy_get_global_memory_context (void )
471
+ {
472
+ if (!PLy_memory_context )
473
+ PLy_memory_context = AllocSetContextCreate (TopMemoryContext ,
474
+ "PL/Python global context" ,
475
+ ALLOCSET_DEFAULT_SIZES );
476
+
477
+ return PLy_memory_context ;
478
+ }
Original file line number Diff line number Diff line change @@ -28,4 +28,7 @@ extern PLyExecutionContext *PLy_current_execution_context(void);
28
28
/* Get the scratch memory context for specified execution context */
29
29
extern MemoryContext PLy_get_scratch_context (PLyExecutionContext * context );
30
30
31
+ /* Get the global memory context */
32
+ extern MemoryContext PLy_get_global_memory_context (void );
33
+
31
34
#endif /* PLPY_MAIN_H */
You can’t perform that action at this time.
0 commit comments