Skip to content

Commit

Permalink
memcpy --> std::memcpy
Browse files Browse the repository at this point in the history
  • Loading branch information
samypr100 committed Mar 8, 2023
1 parent 7a474c1 commit 00b12a4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cpp/open3d/io/file_format/FileXYZ.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ bool WritePointCloudInMemoryToXYZ(unsigned char *&buffer,
}
length = content.length();
buffer = new unsigned char[length]; // we do this for the caller
memcpy(buffer, content.c_str(), length);
std::memcpy(buffer, content.c_str(), length);

reporter.Finish();
return true;
Expand Down
3 changes: 2 additions & 1 deletion cpp/pybind/io/class_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ void pybind_class_io(py::module &m_io) {
const char *dataptr = PYBIND11_BYTES_AS_STRING(bytes.ptr());
auto length = PYBIND11_BYTES_SIZE(bytes.ptr());
auto buffer = new unsigned char[length];
memcpy(buffer, dataptr, length); // copy before releasing GIL
// copy before releasing GIL
std::memcpy(buffer, dataptr, length);
py::gil_scoped_release release;
geometry::PointCloud pcd;
ReadPointCloud(reinterpret_cast<const unsigned char *>(buffer),
Expand Down

0 comments on commit 00b12a4

Please sign in to comment.