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

Function basic_insert_dump_writer

include/sol/bytecode.hpp:98–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96
97 template <typename Container>
98 inline int basic_insert_dump_writer(lua_State*, const void* memory, size_t memory_size, void* userdata_pointer) {
99 using storage_t = Container;
100 const std::byte* p_code = static_cast<const std::byte*>(memory);
101 storage_t& bc = *static_cast<storage_t*>(userdata_pointer);
102#if SOL_IS_OFF(SOL_EXCEPTIONS)
103 bc.insert(bc.cend(), p_code, p_code + memory_size);
104#else
105 try {
106 bc.insert(bc.cend(), p_code, p_code + memory_size);
107 }
108 catch (...) {
109 return -1;
110 }
111#endif
112 return 0;
113 }
114
115 using bytecode = basic_bytecode<>;
116

Callers

nothing calls this directly

Calls 2

insertMethod · 0.45
cendMethod · 0.45

Tested by

no test coverage detected