Skip to content

Commit

Permalink
memcpy --> std::memcpy
Browse files Browse the repository at this point in the history
  • Loading branch information
samypr100 committed Apr 5, 2023
1 parent ee4da5a commit ff5868f
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 ff5868f

Please sign in to comment.