| 3345 | |
| 3346 | template <typename Container> |
| 3347 | inline int basic_insert_dump_writer(lua_State*, const void* memory, size_t memory_size, void* userdata) { |
| 3348 | using storage_t = Container; |
| 3349 | const std::byte* p_code = static_cast<const std::byte*>(memory); |
| 3350 | storage_t& bc = *static_cast<storage_t*>(userdata); |
| 3351 | #if defined(SOL_NO_EXCEPTIONS) && SOL_NO_EXCEPTIONS != 0 |
| 3352 | bc.insert(bc.cend(), p_code, p_code + memory_size); |
| 3353 | #else |
| 3354 | try { |
| 3355 | bc.insert(bc.cend(), p_code, p_code + memory_size); |
| 3356 | } |
| 3357 | catch (...) { |
| 3358 | return -1; |
| 3359 | } |
| 3360 | #endif |
| 3361 | return 0; |
| 3362 | } |
| 3363 | |
| 3364 | using bytecode = basic_bytecode<>; |
| 3365 | |