diff options
author | Benoit Germain <benoit.germain@ubisoft.com> | 2024-06-18 10:06:53 +0200 |
---|---|---|
committer | Benoit Germain <benoit.germain@ubisoft.com> | 2024-06-18 10:06:53 +0200 |
commit | 3229fa753cef10eda963247eaedec1d6ed9de9e4 (patch) | |
tree | 6b8ab7c1895aee63e4db3cca0b38c9a812430a2f /src/universe.cpp | |
parent | e3818609b54c81a83aa73beb322ea9c282b7add8 (diff) | |
download | lanes-3229fa753cef10eda963247eaedec1d6ed9de9e4.tar.gz lanes-3229fa753cef10eda963247eaedec1d6ed9de9e4.tar.bz2 lanes-3229fa753cef10eda963247eaedec1d6ed9de9e4.zip |
Moved AllocatorDefinition in a lanes namespace
Diffstat (limited to 'src/universe.cpp')
-rw-r--r-- | src/universe.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/universe.cpp b/src/universe.cpp index d24a784..770fccf 100644 --- a/src/universe.cpp +++ b/src/universe.cpp | |||
@@ -166,7 +166,7 @@ Universe::Universe() | |||
166 | { | 166 | { |
167 | Universe* const _U{ Universe::Get(L_) }; | 167 | Universe* const _U{ Universe::Get(L_) }; |
168 | // push a new full userdata on the stack, giving access to the universe's protected allocator | 168 | // push a new full userdata on the stack, giving access to the universe's protected allocator |
169 | [[maybe_unused]] AllocatorDefinition* const _def{ new (L_) AllocatorDefinition{ _U->protectedAllocator.makeDefinition() } }; | 169 | [[maybe_unused]] lanes::AllocatorDefinition* const _def{ new (L_) lanes::AllocatorDefinition{ _U->protectedAllocator.makeDefinition() } }; |
170 | return 1; | 170 | return 1; |
171 | } | 171 | } |
172 | 172 | ||
@@ -218,7 +218,7 @@ void Universe::initializeAllocatorFunction(lua_State* const L_) | |||
218 | std::ignore = luaG_getfield(L_, -1, "internal_allocator"); // L_: settings "libc"|"allocator" | 218 | std::ignore = luaG_getfield(L_, -1, "internal_allocator"); // L_: settings "libc"|"allocator" |
219 | std::string_view const _allocator{ luaG_tostring(L_, -1) }; | 219 | std::string_view const _allocator{ luaG_tostring(L_, -1) }; |
220 | if (_allocator == "libc") { | 220 | if (_allocator == "libc") { |
221 | internalAllocator = AllocatorDefinition{ AllocatorDefinition::kAllocatorVersion, libc_lua_Alloc, nullptr }; | 221 | internalAllocator = lanes::AllocatorDefinition{ lanes::AllocatorDefinition::kAllocatorVersion, libc_lua_Alloc, nullptr }; |
222 | } else if (provideAllocator == luaG_provide_protected_allocator) { | 222 | } else if (provideAllocator == luaG_provide_protected_allocator) { |
223 | // user wants mutex protection on the state's allocator. Use protection for our own allocations too, just in case. | 223 | // user wants mutex protection on the state's allocator. Use protection for our own allocations too, just in case. |
224 | internalAllocator = protectedAllocator.makeDefinition(); | 224 | internalAllocator = protectedAllocator.makeDefinition(); |