Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
qubka committed Sep 26, 2024
1 parent 93ae690 commit 4a09701
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions src/module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,14 @@ void std::default_delete<DCCallVM>::operator()(DCCallVM* p) const {

static thread_local VirtualMachine s_vm;

struct VirtualMachine {
[[nodiscard]] DCCallVM& operator()() {
if (_callVirtMachine == nullptr) {
DCCallVM* vm = dcNewCallVM(4096);
dcMode(vm, DC_CALL_C_DEFAULT);
_callVirtMachine = std::unique_ptr<DCCallVM>(vm);
}
return *_callVirtMachine;
[[nodiscard]] DCCallVM& VirtualMachine::operator()() {
if (_callVirtMachine == nullptr) {
DCCallVM* vm = dcNewCallVM(4096);
dcMode(vm, DC_CALL_C_DEFAULT);
_callVirtMachine = std::unique_ptr<DCCallVM>(vm);
}
private:
std::unique_ptr<DCCallVM> _callVirtMachine;
};
return *_callVirtMachine;
}

namespace {
template<class T>
Expand Down

0 comments on commit 4a09701

Please sign in to comment.