MCPcopy Create free account
hub / github.com/ThePhD/sol2 / user_alloc_destroy

Function user_alloc_destroy

include/sol/stack_core.hpp:455–462  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

453
454 template <typename T>
455 int user_alloc_destroy(lua_State* L) noexcept {
456 void* memory = lua_touserdata(L, 1);
457 void* aligned_memory = align_user<T>(memory);
458 T* typed_memory = static_cast<T*>(aligned_memory);
459 std::allocator<T> alloc;
460 std::allocator_traits<std::allocator<T>>::destroy(alloc, typed_memory);
461 return 0;
462 }
463
464 template <typename T, typename Real>
465 void usertype_unique_alloc_destroy(void* memory) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected