We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Here is the snippet, the C string num1_only never gets freed/deleted:
num1_only
char* num1 = strchr(arg[iarg],'=')+1; char* num2 = strpbrk(num1,","); int num1_len = num2==NULL?strlen(num1):num2-num1; char* num1_only = new char[num1_len+1]; strncpy(num1_only,num1,num1_len); num1_only[num1_len]=0; if(!Impl::is_unsigned_int(num1_only) || (strlen(num1_only)==0)) { Impl::throw_runtime_exception("Error: expecting an integer number after command line argument '--kokkos-ndevices'. Raised by Kokkos::initialize(int narg, char* argc[])."); } if((strncmp(arg[iarg],"--kokkos-ndevices",17) == 0) || !kokkos_ndevices_found) ndevices = atoi(num1_only);
Why are we, in a modern C++11 code, calling things like strpbrk and raw new in non-performance-critical code??
strpbrk
new
I'll submit a PR to just call delete in a moment, but the real fix is to get all of this C-style code replaced with std::string.
delete
std::string
More importantly, we should incorporate Valgrind into Kokkos testing.
The text was updated successfully, but these errors were encountered:
Fix memory leak in Kokkos::initialize
86c402b
[#1194]
but the real fix is to get all of this C-style code replaced with std::string.
+1 (more like +N)
Sorry, something went wrong.
ibaned
No branches or pull requests
Here is the snippet, the C string
num1_only
never gets freed/deleted:Why are we, in a modern C++11 code, calling things like
strpbrk
and rawnew
in non-performance-critical code??I'll submit a PR to just call
delete
in a moment, but the real fix is to get all of this C-style code replaced withstd::string
.More importantly, we should incorporate Valgrind into Kokkos testing.
The text was updated successfully, but these errors were encountered: