mirror of
https://github.com/wassname/ray.git
synced 2026-07-23 13:10:11 +08:00
[Asyncio] Increase recursion limit manually (#7142)
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
# cython: embedsignature = True
|
||||
# cython: language_level = 3
|
||||
|
||||
from cpython.pystate cimport PyThreadState_Get
|
||||
|
||||
from libcpp cimport bool as c_bool
|
||||
from libcpp.string cimport string as c_string
|
||||
from libcpp.vector cimport vector as c_vector
|
||||
@@ -24,6 +26,19 @@ from ray.includes.function_descriptor cimport (
|
||||
CFunctionDescriptor,
|
||||
)
|
||||
|
||||
cdef extern from "Python.h":
|
||||
# Note(simon): This is used to configure asyncio actor stack size.
|
||||
# Cython made PyThreadState an opaque types. Saying that if the user wants
|
||||
# specific attributes, they can be declared manually.
|
||||
|
||||
# You can find the cpython definition in Include/cpython/pystate.h#L59
|
||||
ctypedef struct CPyThreadState "PyThreadState":
|
||||
int recursion_depth
|
||||
|
||||
# From Include/ceveal.h#67
|
||||
int Py_GetRecursionLimit()
|
||||
void Py_SetRecursionLimit(int)
|
||||
|
||||
cdef class Buffer:
|
||||
cdef:
|
||||
shared_ptr[CBuffer] buffer
|
||||
|
||||
Reference in New Issue
Block a user