Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a79d495

Browse files
gumb0axic
authored andcommittedJun 20, 2022
capi: Add functions to access depth and ticks of ExecutionContext
1 parent 9ec2bbb commit a79d495

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed
 

‎include/fizzy/fizzy.h

+3
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,9 @@ FizzyExecutionContext* fizzy_create_metered_execution_context(
603603

604604
void fizzy_free_execution_context(FizzyExecutionContext* ctx) FIZZY_NOEXCEPT;
605605

606+
int* fizzy_get_execution_context_depth(FizzyExecutionContext* ctx) FIZZY_NOEXCEPT;
607+
608+
int64_t* fizzy_get_execution_context_ticks(FizzyExecutionContext* ctx) FIZZY_NOEXCEPT;
606609

607610
/// Execute module function.
608611
///

‎lib/fizzy/capi.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,16 @@ void fizzy_free_execution_context(FizzyExecutionContext* c_ctx) noexcept
727727
delete unwrap(c_ctx);
728728
}
729729

730+
int* fizzy_get_execution_context_depth(FizzyExecutionContext* c_ctx) noexcept
731+
{
732+
return &unwrap(c_ctx)->depth;
733+
}
734+
735+
int64_t* fizzy_get_execution_context_ticks(FizzyExecutionContext* c_ctx) noexcept
736+
{
737+
return &unwrap(c_ctx)->ticks;
738+
}
739+
730740
FizzyExecutionResult fizzy_execute(FizzyInstance* c_instance, uint32_t func_idx,
731741
const FizzyValue* c_args, FizzyExecutionContext* c_ctx) noexcept
732742
{

0 commit comments

Comments
 (0)
Please sign in to comment.