From 1b6de428178fba3ac3aab2e762bfdf5b937631e0 Mon Sep 17 00:00:00 2001 From: Jrenaud-Desk Date: Sun, 1 Dec 2024 16:17:16 -0500 Subject: [PATCH] testing --- CyRK/cy/cysolver.cpp | 49 +++++++++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/CyRK/cy/cysolver.cpp b/CyRK/cy/cysolver.cpp index 6c201e6..fe1892c 100644 --- a/CyRK/cy/cysolver.cpp +++ b/CyRK/cy/cysolver.cpp @@ -62,31 +62,38 @@ CySolverBase::CySolverBase( this->storage_sptr->update_message("CySolverBase Initializing."); // Build storage for args - if (args_ptr && (size_of_args > 0)) + if (0) { - // Allocate memory for the size of args. - // Store void pointer to it. - printf("Pre resize\n"); - this->args_char_vec.resize(size_of_args); - - // Copy over contents of arg - char* args_in_as_char_ptr = (char*)args_ptr; - printf("Pre Copy Over: arg_in_char = %p; sizeof = %d; args_in_char+size = %p\n", args_in_as_char_ptr, size_of_args, args_in_as_char_ptr + size_of_args); - this->args_char_vec.insert(this->args_char_vec.begin(), args_in_as_char_ptr, args_in_as_char_ptr + size_of_args); - // std::memcpy(this->args_ptr, args_ptr, size_of_args); - - this->args_ptr = (void*)this->args_char_vec.data(); - printf("Post\n"); + if (args_ptr && (size_of_args > 0)) + { + // Allocate memory for the size of args. + // Store void pointer to it. + printf("Pre resize\n"); + this->args_char_vec.resize(size_of_args); + + // Copy over contents of arg + char* args_in_as_char_ptr = (char*)args_ptr; + printf("Pre Copy Over: arg_in_char = %p; sizeof = %d; args_in_char+size = %p\n", args_in_as_char_ptr, size_of_args, args_in_as_char_ptr + size_of_args); + this->args_char_vec.insert(this->args_char_vec.begin(), args_in_as_char_ptr, args_in_as_char_ptr + size_of_args); + // std::memcpy(this->args_ptr, args_ptr, size_of_args); + + this->args_ptr = (void*)this->args_char_vec.data(); + printf("Post\n"); + } + else + { + this->args_char_vec.resize(8); + for (size_t i = 0; i < 8; i++) + { + this->args_char_vec[i] = 0; + } + + this->args_ptr = (void*)this->args_char_vec.data(); + } } else { - this->args_char_vec.resize(8); - for (size_t i = 0; i < 8; i++) - { - this->args_char_vec[i] = 0; - } - - this->args_ptr = (void*)this->args_char_vec.data(); + this->args_ptr = args_ptr; } // Check for errors