[libc-commits] [libc] [libc] Remove use of C++ STL features from `rpc_server.cpp` (PR #131169)
Joseph Huber via libc-commits
libc-commits at lists.llvm.org
Thu Mar 13 10:02:50 PDT 2025
================
@@ -270,7 +324,7 @@ rpc::Status handle_port_impl(rpc::Server::Port &port) {
});
port.send_n(data, sizes);
port.send([&](rpc::Buffer *buffer, uint32_t id) {
- std::memcpy(buffer->data, &sizes[id], sizeof(uint64_t));
+ __builtin_memcpy(buffer->data, &sizes[id], sizeof(uint64_t));
----------------
jhuber6 wrote:
The builtin is usually better and it's supported by all the compilers that we support to compile this. The strlen just lowers to a libcall AFAIK. It does help somewhat to not need more libc headers. However, since I'm using `libc` stuff it's possible that I could just include the existing libc wrapper headers to get the definitions. Then it's up to wheover provides the libc to resolve those. Could be glibc or LLVM libc in the future.
https://github.com/llvm/llvm-project/pull/131169
More information about the libc-commits
mailing list