[libc-commits] [PATCH] D150513: [libc] Simplify RPC send and recv callback interface

Joseph Huber via Phabricator via libc-commits libc-commits at lists.llvm.org
Sat May 13 14:26:50 PDT 2023


jhuber6 created this revision.
jhuber6 added reviewers: jdoerfert, JonChesterfield, tianshilei1992, lntue, michaelrj, sivachandra.
Herald added subscribers: libc-commits, ecnelises, tschuett.
Herald added projects: libc-project, All.
jhuber6 requested review of this revision.

We use lambda callbacks as the main way to interface with the `send` and
`recv` functions at the core of the RPC interface. This provided the
user with a pointer to the underlying data buffer to use. However, this
was somewhat annoying to use as it required constant bit casts. This
patch uses template magic to infer the desired type and automatically
cast to what the user passes in. Some static checks ensure that this is
actually legal. This will allow for functions to more easily describe
structs that match the expected argument format.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D150513

Files:
  libc/src/__support/CPP/type_traits.h
  libc/src/__support/OSUtil/gpu/quick_exit.cpp
  libc/src/__support/RPC/rpc.h
  libc/src/__support/RPC/rpc_util.h
  libc/test/integration/startup/gpu/rpc_test.cpp
  libc/utils/gpu/loader/Server.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D150513.521948.patch
Type: text/x-patch
Size: 10018 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20230513/11c339d6/attachment.bin>


More information about the libc-commits mailing list