File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -1360,8 +1360,16 @@ All of the following functions must be called after :c:func:`Py_Initialize`.
13601360   On success, return ``0``. 
13611361   On failure, set an exception and return ``-1``. 
13621362
1363-    .. seealso:: 
1364-       The :c:func:`PyUnstable_ThreadState_ResetStack` function. 
1363+    CPython implements :ref:`recursion control <recursion>` for C code by raising 
1364+    :py:exc:`RecursionError` when it notices that the machine execution stack is close 
1365+    to overflow. 
1366+    For this, it needs to know the location of the current thread's stack, which it 
1367+    normally gets from the operating system. 
1368+    When the stack is changed, for example using context switching techniques like the 
1369+    Boost library's ``boost::context``, you must call 
1370+    :c:func:`~PyUnstable_ThreadState_SetStack` to inform CPython of the change. 
1371+ 
1372+    See :c:func:`PyUnstable_ThreadState_ResetStack` for undoing this operation. 
13651373
13661374   .. versionadded:: next 
13671375
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments