aboutsummaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
authorJoseph Huber <jhuber6@vols.utk.edu>2023-07-19 10:58:45 -0500
committerJoseph Huber <jhuber6@vols.utk.edu>2023-07-19 11:38:46 -0500
commit90eea57d755c570437cd8f5cf3599198997c592e (patch)
treed970f36d5758cd74075b3d637b3621c8d1d5893c /libc
parentefedcbeeb88c3cfd6fffb861067e36c43476a002 (diff)
downloadllvm-90eea57d755c570437cd8f5cf3599198997c592e.zip
llvm-90eea57d755c570437cd8f5cf3599198997c592e.tar.gz
llvm-90eea57d755c570437cd8f5cf3599198997c592e.tar.bz2
[libc] Fix global constructor being emitted for the RPC client
The indirection here is for some reason causing an unnecessary constructor. If we leave this uninitialized we will get the default constructor which simply zero initliaizes the global. I've checked the output and confirmed that it uses the `zeroinitializer` so this should be safe. Reviewed By: JonChesterfield Differential Revision: https://reviews.llvm.org/D155720
Diffstat (limited to 'libc')
-rw-r--r--libc/src/__support/RPC/rpc.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/libc/src/__support/RPC/rpc.h b/libc/src/__support/RPC/rpc.h
index d91a5c8..9f5c842 100644
--- a/libc/src/__support/RPC/rpc.h
+++ b/libc/src/__support/RPC/rpc.h
@@ -82,10 +82,10 @@ template <bool Invert, typename Packet> struct Process {
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};