pub struct GILPool { /* private fields */ }
Expand description
A RAII pool which PyO3 uses to store owned Python references.
See the Memory Management chapter of the guide for more information about how PyO3 uses
GILPool
to manage memory.
Implementations§
source§impl GILPool
impl GILPool
sourcepub unsafe fn new() -> GILPool
pub unsafe fn new() -> GILPool
Creates a new GILPool
. This function should only ever be called with the GIL held.
It is recommended not to use this API directly, but instead to use Python::new_pool
, as
that guarantees the GIL is held.
Safety
As well as requiring the GIL, see the safety notes on Python::new_pool
.