Skip to content

Commit

Permalink
memcpy --> std::memcpy
Browse files Browse the repository at this point in the history
  • Loading branch information
samypr100 committed Feb 20, 2023
1 parent e8327ee commit 8a76a28
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 @@ -164,7 +164,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 @@ -202,7 +202,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 8a76a28

Please sign in to comment.