new mutation function partially works

thread
Brett 2024-08-10 04:41:41 -04:00
parent 9f7c647952
commit 502ea6ea36
4 changed files with 7 additions and 3 deletions

View File

@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.25) cmake_minimum_required(VERSION 3.25)
project(blt-gp VERSION 0.0.127) project(blt-gp VERSION 0.0.128)
include(CTest) include(CTest)

View File

@ -79,7 +79,7 @@ namespace blt::gp
blt::size_t offset = 0; blt::size_t offset = 0;
blt::size_t current_index = 0; blt::size_t current_index = 0;
((offset += (current_index++ > index ? stack_allocator::aligned_size<detail::remove_cv_ref<Args>>() : 0)), ...); ((offset += (current_index++ > index ? stack_allocator::aligned_size<detail::remove_cv_ref<Args>>() : 0)), ...);
//BLT_INFO("offset %ld for index %ld", offset, index); // BLT_INFO("offset %ld for argument %ld", offset, index);
return offset; return offset;
} }
@ -87,6 +87,8 @@ namespace blt::gp
inline static constexpr Return exec_sequence_to_indices(Func&& func, stack_allocator& allocator, std::integer_sequence<blt::u64, indices...>, inline static constexpr Return exec_sequence_to_indices(Func&& func, stack_allocator& allocator, std::integer_sequence<blt::u64, indices...>,
ExtraArgs&& ... args) ExtraArgs&& ... args)
{ {
//BLT_INFO("Arguments:");
//(BLT_INFO("%ld: %s", indices, blt::type_string<Args>().c_str()) , ...);
//blt::size_t arg_size = (stack_allocator::aligned_size<detail::remove_cv_ref<Args>>() + ...); //blt::size_t arg_size = (stack_allocator::aligned_size<detail::remove_cv_ref<Args>>() + ...);
//BLT_TRACE(arg_size); //BLT_TRACE(arg_size);
// expands Args and indices, providing each argument with its index calculating the current argument byte offset // expands Args and indices, providing each argument with its index calculating the current argument byte offset

View File

@ -267,6 +267,8 @@ namespace blt::gp
if (blk->used_bytes_in_block() < static_cast<blt::ptrdiff_t>(TYPE_SIZE)) if (blk->used_bytes_in_block() < static_cast<blt::ptrdiff_t>(TYPE_SIZE))
{ {
BLT_WARN_STREAM << size() << "\n"; BLT_WARN_STREAM << size() << "\n";
BLT_WARN_STREAM << "Requested " << bytes << " bytes which becomes " << (bytes + TYPE_SIZE) << "\n";
BLT_WARN_STREAM << "Block size: " << blk->storage_size() << "\n";
BLT_ABORT((std::string("Mismatched Types! Not enough space left in block! Bytes: ") += std::to_string( BLT_ABORT((std::string("Mismatched Types! Not enough space left in block! Bytes: ") += std::to_string(
blk->used_bytes_in_block()) += " Size: " + std::to_string(sizeof(NO_REF_T))).c_str()); blk->used_bytes_in_block()) += " Size: " + std::to_string(sizeof(NO_REF_T))).c_str());
} }

@ -1 +1 @@
Subproject commit 941aedb510d298851dadce32e5b20f85c9844969 Subproject commit 99e735b7601716caf9e5b6dbac0ae22b2ab99b3d