§tiro::vm

#include "tiropp/vm.hpp"

§Public Functions

Name
const std::any &userdata() const
Userdata associated with this virtual machine.
std::any &userdata()
Userdata associated with this virtual machine.
vm()
Constructs a new vm with default settings.
vm(vm_settings settings)
Constructs a new vm with the given settings.
vm(vm && ) =delete
vm &operator=(vm && ) =delete
size_tpage_size() const
Returns the vm's page size, in bytes.
size_tmax_heap_size() const
Returns the vm's maximum heap size, in bytes.
voidload_std()
Loads the "std" module.
voidload(const compiled_module & mod)
Loads the given compiled module.
boolhas_ready() const
Returns true if the virtual machine has at least one coroutine ready for execution, false otherwise.
voidrun_ready()
Runs all ready coroutines. Returns (and does not block) when all coroutines are either waiting or done.
tiro_vm_traw_vm() const
Returns the raw virtual machine instance managed by this object.
vm &unsafe_from_raw_vm(tiro_vm_t raw_vm)
Returns a reference to the original tiro::vm instance.

§Public Functions Documentation

§function userdata

inline const std::any & userdata() const

Userdata associated with this virtual machine.

§function userdata

inline std::any & userdata()

Userdata associated with this virtual machine.

§function vm

inline vm()

Constructs a new vm with default settings.

§function vm

inline explicit vm(
vm_settings settings
)

Constructs a new vm with the given settings.

§function vm

vm(
vm &&
) =delete

§function operator=

vm & operator=(
vm &&
) =delete

§function page_size

inline size_t page_size() const

Returns the vm's page size, in bytes.

§function max_heap_size

inline size_t max_heap_size() const

Returns the vm's maximum heap size, in bytes.

§function load_std

inline void load_std()

Loads the "std" module.

§function load

inline void load(
const compiled_module & mod
)

Loads the given compiled module.

§function has_ready

inline bool has_ready() const

Returns true if the virtual machine has at least one coroutine ready for execution, false otherwise.

§function run_ready

inline void run_ready()

Runs all ready coroutines. Returns (and does not block) when all coroutines are either waiting or done.

§function raw_vm

inline tiro_vm_t raw_vm() const

Returns the raw virtual machine instance managed by this object.

§function unsafe_from_raw_vm

static inline vm & unsafe_from_raw_vm(
tiro_vm_t raw_vm
)

Returns a reference to the original tiro::vm instance.

The raw_vm MUST have been created by the tiro::vm constructor.


Updated on 2022-02-27 at 21:17:13 +0100