2021-03-24 22:37:53 +01:00
|
|
|
#include "cs_thread.hh"
|
|
|
|
|
|
|
|
#include "cs_gen.hh"
|
|
|
|
|
|
|
|
namespace cubescript {
|
|
|
|
|
|
|
|
thread_state::thread_state(internal_state *cs):
|
2021-03-30 00:28:06 +02:00
|
|
|
vmstack{cs}, idstack{cs}, errbuf{cs}
|
2021-03-24 22:37:53 +01:00
|
|
|
{
|
2021-03-28 01:33:31 +01:00
|
|
|
vmstack.reserve(32);
|
2021-03-30 00:28:06 +02:00
|
|
|
idstack.reserve(MAX_ARGUMENTS);
|
2021-03-24 22:37:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
hook_func thread_state::set_hook(hook_func f) {
|
|
|
|
auto hk = std::move(call_hook);
|
|
|
|
call_hook = std::move(f);
|
|
|
|
return hk;
|
|
|
|
}
|
|
|
|
|
2021-03-28 01:33:31 +01:00
|
|
|
} /* namespace cubescript */
|