File tree 2 files changed +29
-0
lines changed
2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -596,6 +596,14 @@ bool fizzy_find_exported_memory(
596
596
bool fizzy_find_exported_global (
597
597
FizzyInstance* instance, const char * name, FizzyExternalGlobal* out_global) FIZZY_NOEXCEPT;
598
598
599
+ FizzyExecutionContext* fizzy_create_execution_context (int depth) FIZZY_NOEXCEPT;
600
+
601
+ FizzyExecutionContext* fizzy_create_metered_execution_context (
602
+ int depth, int64_t ticks) FIZZY_NOEXCEPT;
603
+
604
+ void fizzy_free_execution_context (FizzyExecutionContext* ctx) FIZZY_NOEXCEPT;
605
+
606
+
599
607
// / Execute module function.
600
608
// /
601
609
// / @param instance Pointer to module instance. Cannot be NULL.
Original file line number Diff line number Diff line change @@ -706,6 +706,27 @@ size_t fizzy_get_instance_memory_size(FizzyInstance* instance) noexcept
706
706
return memory->size ();
707
707
}
708
708
709
+ FizzyExecutionContext* fizzy_create_execution_context (int depth) noexcept
710
+ {
711
+ auto ctx = std::make_unique<fizzy::ExecutionContext>();
712
+ ctx->depth = depth;
713
+ return wrap (ctx.release ());
714
+ }
715
+
716
+ FizzyExecutionContext* fizzy_create_metered_execution_context (int depth, int64_t ticks) noexcept
717
+ {
718
+ auto ctx = std::make_unique<fizzy::ExecutionContext>();
719
+ ctx->depth = depth;
720
+ ctx->metering_enabled = true ;
721
+ ctx->ticks = ticks;
722
+ return wrap (ctx.release ());
723
+ }
724
+
725
+ void fizzy_free_execution_context (FizzyExecutionContext* c_ctx) noexcept
726
+ {
727
+ delete unwrap (c_ctx);
728
+ }
729
+
709
730
FizzyExecutionResult fizzy_execute (FizzyInstance* c_instance, uint32_t func_idx,
710
731
const FizzyValue* c_args, FizzyExecutionContext* c_ctx) noexcept
711
732
{
You can’t perform that action at this time.
0 commit comments