mirror of
https://github.com/ChaiScript/ChaiScript.git
synced 2025-12-14 23:50:03 +08:00
ChaiScript 6 always used a shared_ptr to wrap C++ objects created in ChaiScript. Newer versions avoid this by only wrapping objects that cannot be copied. This has the side effect that ChaiScript depends on correctly implemented C++ copy and move constructors in unexpected locations. I don't think the reduced overhead (by avoiding the shared_ptr) justifies the new behavior in every case. Therefore, I suggest we temporarily only perform this optimization if the class is trivially destructible, until unexpected copies and moves in ChaiScript are fixed (if this is even possible), or there is a sanitizer/compiler warning that can detect these cases. Before the change the following code will call the ctor once, move once, and the dtor twice: auto obj = MoveableObject(); After this change it will only call the ctor once and the dtor once. |
||
|---|---|---|
| .. | ||
| any.hpp | ||
| bad_boxed_cast.hpp | ||
| bind_first.hpp | ||
| bootstrap_stl.hpp | ||
| bootstrap.hpp | ||
| boxed_cast_helper.hpp | ||
| boxed_cast.hpp | ||
| boxed_number.hpp | ||
| boxed_value.hpp | ||
| callable_traits.hpp | ||
| dispatchkit.hpp | ||
| dynamic_object_detail.hpp | ||
| dynamic_object.hpp | ||
| exception_specification.hpp | ||
| function_call_detail.hpp | ||
| function_call.hpp | ||
| function_params.hpp | ||
| function_signature.hpp | ||
| handle_return.hpp | ||
| operators.hpp | ||
| proxy_constructors.hpp | ||
| proxy_functions_detail.hpp | ||
| proxy_functions.hpp | ||
| register_function.hpp | ||
| short_alloc.hpp | ||
| type_conversions.hpp | ||
| type_info.hpp | ||