@@ -27,7 +27,7 @@ use super::{Lua, WeakLua};
2727// Unique key to store `ExtraData` in the registry
2828static EXTRA_REGISTRY_KEY : u8 = 0 ;
2929
30- const WRAPPED_FAILURE_POOL_SIZE : usize = 64 ;
30+ const WRAPPED_FAILURE_POOL_DEFAULT_CAPACITY : usize = 64 ;
3131const REF_STACK_RESERVE : c_int = 1 ;
3232
3333/// Data associated with the Lua state.
@@ -60,6 +60,7 @@ pub(crate) struct ExtraData {
6060
6161 // Pool of `WrappedFailure` enums in the ref thread (as userdata)
6262 pub ( super ) wrapped_failure_pool : Vec < c_int > ,
63+ pub ( super ) wrapped_failure_top : usize ,
6364 // Pool of `Thread`s (coroutines) for async execution
6465 #[ cfg( feature = "async" ) ]
6566 pub ( super ) thread_pool : Vec < c_int > ,
@@ -160,7 +161,8 @@ impl ExtraData {
160161 ref_stack_size : ffi:: LUA_MINSTACK - REF_STACK_RESERVE ,
161162 ref_stack_top : ffi:: lua_gettop ( ref_thread) ,
162163 ref_free : Vec :: new ( ) ,
163- wrapped_failure_pool : Vec :: with_capacity ( WRAPPED_FAILURE_POOL_SIZE ) ,
164+ wrapped_failure_pool : Vec :: with_capacity ( WRAPPED_FAILURE_POOL_DEFAULT_CAPACITY ) ,
165+ wrapped_failure_top : 0 ,
164166 #[ cfg( feature = "async" ) ]
165167 thread_pool : Vec :: new ( ) ,
166168 wrapped_failure_mt_ptr,
0 commit comments