mem tests

dev-func-drop
Brett 2025-01-17 12:18:59 -05:00
parent 316f973fd8
commit 87d0a46552
4 changed files with 16 additions and 3 deletions

View File

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

View File

@ -198,7 +198,7 @@ namespace blt::gp
[[nodiscard]] bool return_has_ephemeral_drop() const
{
return detail::has_func_drop_ephemeral_v<Return>;
return detail::has_func_drop_v<Return>;
}
operator_id id = -1;

View File

@ -48,7 +48,7 @@ namespace blt::gp
template <typename T>
static type make_type(const type_id id)
{
return type(stack_allocator::aligned_size<T>(), id, blt::type_string<T>(), detail::has_func_drop_ephemeral_v<T>);
return type(stack_allocator::aligned_size<T>(), id, blt::type_string<T>(), detail::has_func_drop_v<T>);
}
[[nodiscard]] size_t size() const

View File

@ -123,6 +123,19 @@ bool fitness_function(const tree_t& current_tree, fitness_t& fitness, size_t)
int main()
{
int silly = 53;
int* silly_ptr = &silly;
blt::mem::print_bytes(std::cout, silly_ptr);
for (blt::size_t i = 49; i < 64; i++)
{
silly_ptr = reinterpret_cast<int*>(reinterpret_cast<std::uintptr_t>(silly_ptr) | 1ul << i);
}
blt::mem::print_bytes(std::cout, silly_ptr);
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());