[libc-commits] [PATCH] D155720: [libc] Fix global constructor being emitted for the RPC client

Joseph Huber via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed Jul 19 09:12:10 PDT 2023


jhuber6 updated this revision to Diff 542061.
jhuber6 added a comment.

Better solution, default initializing everything else also prevents it from being emitted.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155720/new/

https://reviews.llvm.org/D155720

Files:
  libc/src/__support/RPC/rpc.h


Index: libc/src/__support/RPC/rpc.h
===================================================================
--- libc/src/__support/RPC/rpc.h
+++ libc/src/__support/RPC/rpc.h
@@ -82,10 +82,10 @@
   LIBC_INLINE Process &operator=(Process &&) = default;
   LIBC_INLINE ~Process() = default;
 
-  uint64_t port_count;
-  cpp::Atomic<uint32_t> *inbox;
-  cpp::Atomic<uint32_t> *outbox;
-  Packet *packet;
+  uint64_t port_count = 0;
+  cpp::Atomic<uint32_t> *inbox = nullptr;
+  cpp::Atomic<uint32_t> *outbox = nullptr;
+  Packet *packet = nullptr;
 
   cpp::Atomic<uint32_t> lock[DEFAULT_PORT_COUNT] = {0};
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D155720.542061.patch
Type: text/x-patch
Size: 601 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20230719/b902afd2/attachment.bin>


More information about the libc-commits mailing list