diff options
author | Benoit Germain <benoit.germain@ubisoft.com> | 2024-03-26 11:36:30 +0100 |
---|---|---|
committer | Benoit Germain <benoit.germain@ubisoft.com> | 2024-03-26 11:36:30 +0100 |
commit | be2f2b4314799d38901c9e80dd35dee63f541c90 (patch) | |
tree | 12862774cf32f5da40afe0c481b0357edc36f565 /src/state.cpp | |
parent | 051a587071e1bd25f72c77e84443be4a3426c83d (diff) | |
download | lanes-be2f2b4314799d38901c9e80dd35dee63f541c90.tar.gz lanes-be2f2b4314799d38901c9e80dd35dee63f541c90.tar.bz2 lanes-be2f2b4314799d38901c9e80dd35dee63f541c90.zip |
C++ migration: refactor AllocatorDefinition and ProtectedAllocator into classes
Diffstat (limited to 'src/state.cpp')
-rw-r--r-- | src/state.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/state.cpp b/src/state.cpp index c66242c..7bdaec9 100644 --- a/src/state.cpp +++ b/src/state.cpp | |||
@@ -260,14 +260,14 @@ lua_State* create_state( Universe* U, lua_State* from_) | |||
260 | lua_call( from_, 0, 1); | 260 | lua_call( from_, 0, 1); |
261 | { | 261 | { |
262 | AllocatorDefinition* const def = (AllocatorDefinition*) lua_touserdata( from_, -1); | 262 | AllocatorDefinition* const def = (AllocatorDefinition*) lua_touserdata( from_, -1); |
263 | L = lua_newstate( def->allocF, def->allocUD); | 263 | L = lua_newstate( def->m_allocF, def->m_allocUD); |
264 | } | 264 | } |
265 | lua_pop( from_, 1); | 265 | lua_pop( from_, 1); |
266 | } | 266 | } |
267 | else | 267 | else |
268 | { | 268 | { |
269 | // reuse the allocator provided when the master state was created | 269 | // reuse the allocator provided when the master state was created |
270 | L = lua_newstate( U->protected_allocator.definition.allocF, U->protected_allocator.definition.allocUD); | 270 | L = lua_newstate(U->protected_allocator.m_allocF, U->protected_allocator.m_allocUD); |
271 | } | 271 | } |
272 | #endif // LUAJIT_FLAVOR() == 64 | 272 | #endif // LUAJIT_FLAVOR() == 64 |
273 | 273 | ||