Skip to content

Commit

Permalink
* Use std::uninitialized_copy in VectorAdapter to make sure copy…
Browse files Browse the repository at this point in the history
… constructors get called (pull #465)
  • Loading branch information
magzot authored Mar 10, 2021
1 parent 496efac commit 300ac72
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

* Use `std::uninitialized_copy` in `VectorAdapter` to make sure copy constructors get called ([pull #465](https://github.com/bytedeco/javacpp/pull/465))

### March 8, 2021 version 1.5.5
* Ensure `System.gc()` never gets called with "org.bytedeco.javacpp.nopointergc" ([issue tensorflow/java#208](https://github.com/tensorflow/java/issues/208))
* Add `Info.immutable` to disable generating setters for public data members ([pull #461](https://github.com/bytedeco/javacpp/pull/461))
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/bytedeco/javacpp/tools/Generator.java
Original file line number Diff line number Diff line change
Expand Up @@ -1119,7 +1119,7 @@ boolean classes(boolean handleExceptions, boolean defineAdapters, boolean conver
out.println(" ptr = (P*)(operator new(sizeof(P) * vec.size(), std::nothrow_t()));");
out.println(" }");
out.println(" if (ptr) {");
out.println(" std::copy(vec.begin(), vec.end(), ptr);");
out.println(" std::uninitialized_copy(vec.begin(), vec.end(), ptr);");
out.println(" }");
out.println(" size = vec.size();");
out.println(" owner = ptr;");
Expand Down

0 comments on commit 300ac72

Please sign in to comment.