Skip to content

Commit c849bf2

Browse files
committed
VirtualMachine: Add registerCount getter
1 parent 02cd2e7 commit c849bf2

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

include/scratchcpp/virtualmachine.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ class LIBSCRATCHCPP_EXPORT VirtualMachine
109109

110110
unsigned int *bytecode() const;
111111

112+
size_t registerCount() const;
113+
112114
Target *target() const;
113115
IEngine *engine() const;
114116
Script *script() const;

src/engine/virtualmachine.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ unsigned int *VirtualMachine::bytecode() const
6969
return impl->bytecode;
7070
}
7171

72+
/*! Returns number of currently used registers. */
73+
size_t VirtualMachine::registerCount() const
74+
{
75+
return impl->regCount;
76+
}
77+
7278
/*! Returns the Target the VM belongs to. */
7379
Target *VirtualMachine::target() const
7480
{

0 commit comments

Comments
 (0)