dev-func-drop
Brett 2025-01-16 19:47:22 -05:00
parent f7d28d7a65
commit 316f973fd8
4 changed files with 7 additions and 16 deletions

View File

@ -27,7 +27,7 @@ macro(compile_options target_name)
sanitizers(${target_name})
endmacro()
project(blt-gp VERSION 0.3.16)
project(blt-gp VERSION 0.3.17)
include(CTest)

View File

@ -42,7 +42,7 @@ namespace blt::gp
namespace detail
{
BLT_META_MAKE_FUNCTION_CHECK(drop);
BLT_META_MAKE_FUNCTION_CHECK(drop_ephemeral);
// BLT_META_MAKE_FUNCTION_CHECK(drop_ephemeral);
}
class stack_allocator
@ -87,7 +87,7 @@ namespace blt::gp
static constexpr size_t aligned_size() noexcept
{
const auto bytes = detail::aligned_size(sizeof(NO_REF_T<T>));
if constexpr (blt::gp::detail::has_func_drop_ephemeral_v<T>)
if constexpr (blt::gp::detail::has_func_drop_v<T>)
return bytes + sizeof(std::atomic_uint64_t*);
return bytes;
}

@ -1 +1 @@
Subproject commit 2e6abb8013a622771330c17f0d938db5f672f12b
Subproject commit 1aa7f12c0f0b6d910d4baef51bb530a819663a3d

View File

@ -49,16 +49,12 @@ struct drop_type
void drop() const
{
if (!ephemeral)
if (ephemeral)
++ephemeral_drop;
else
++normal_drop;
}
void drop_ephemeral() const
{
// BLT_TRACE("Wow silly type of value %f was dropped!", value);
++ephemeral_drop;
}
friend std::ostream& operator<<(std::ostream& os, const drop_type& dt)
{
os << dt.value;
@ -127,11 +123,6 @@ bool fitness_function(const tree_t& current_tree, fitness_t& fitness, size_t)
int main()
{
int hello = 32;
int* silly = &hello;
blt::mem::print_bytes(std::cout, silly);
return 0;
operator_builder<context> builder{};
builder.build(add, sub, mul, pro_div, op_sin, op_cos, op_exp, op_log, lit, op_x);
regression.get_program().set_operations(builder.grab());