aboutsummaryrefslogtreecommitdiff
path: root/src/state.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/state.cpp')
-rw-r--r--src/state.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/state.cpp b/src/state.cpp
index 3f6b3d7..ee0b199 100644
--- a/src/state.cpp
+++ b/src/state.cpp
@@ -208,6 +208,9 @@ namespace state {
208 lua_pushcclosure(from, U->provideAllocator, 0); 208 lua_pushcclosure(from, U->provideAllocator, 0);
209 lua_call(from, 0, 1); 209 lua_call(from, 0, 1);
210 AllocatorDefinition* const _def{ luaG_tofulluserdata<AllocatorDefinition>(from, -1) }; 210 AllocatorDefinition* const _def{ luaG_tofulluserdata<AllocatorDefinition>(from, -1) };
211 if (!_def || _def->version != AllocatorDefinition::kAllocatorVersion) {
212 raise_luaL_error(from, "Bad config.allocator function, must provide a valid AllocatorDefinition");
213 }
211 lua_State* const _L{ lua_newstate(_def->allocF, _def->allocUD) }; 214 lua_State* const _L{ lua_newstate(_def->allocF, _def->allocUD) };
212 lua_pop(from, 1); 215 lua_pop(from, 1);
213 return _L; 216 return _L;