[libc-commits] [PATCH] D147054: [libc] Begin implementing a library for the RPC server
Joseph Huber via Phabricator via libc-commits
libc-commits at lists.llvm.org
Wed Jun 14 13:27:12 PDT 2023
jhuber6 marked 5 inline comments as done.
jhuber6 added inline comments.
================
Comment at: libc/utils/gpu/server/Server.h:57
+/// A function used to free the \p ptr previously allocated.
+typedef void(rpc_free_ty)(void *ptr, void *data);
+
----------------
JonChesterfield wrote:
> This looks like the type of a function, not the type of a function pointer. It's used as an argument to functions where it'll decay to the pointer type. More conventionally written with an extra *
>
> typedef void(*rpc_free_ty)(void *ptr, void *data);
>
> Is there a benefit to declaring this as the function type as opposed to the function pointer type?
I just forgot to add it and my IDE took care of the conversions when I got an error, will change.
================
Comment at: libc/utils/gpu/server/Server.h:70
+/// Shut down the rpc interface.
+rpc_status_t rpc_shutdown();
+
----------------
JonChesterfield wrote:
> Want `(void)` if this is meant to be usable from C (the guards about suggest it is)
>
> C++ thinks foo() is a function of no arguments. C thinks it's some aberration from the past (though that might have been dropped in the last standard).
Forgot about that quirk of C, thanks.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D147054/new/
https://reviews.llvm.org/D147054
More information about the libc-commits
mailing list