[libc-commits] [libc] e376f31 - [libc] Make RPC allocation size query constexpr
Joseph Huber via libc-commits
libc-commits at lists.llvm.org
Wed Mar 26 07:21:56 PDT 2025
Author: Joseph Huber
Date: 2025-03-26T09:21:43-05:00
New Revision: e376f3129ae90e20b6629f8554872990daa0b2fb
URL: https://github.com/llvm/llvm-project/commit/e376f3129ae90e20b6629f8554872990daa0b2fb
DIFF: https://github.com/llvm/llvm-project/commit/e376f3129ae90e20b6629f8554872990daa0b2fb.diff
LOG: [libc] Make RPC allocation size query constexpr
Summary:
Let this be used for a static array.
Added:
Modified:
libc/shared/rpc.h
Removed:
################################################################################
diff --git a/libc/shared/rpc.h b/libc/shared/rpc.h
index dd46d5dcb3dc0..7295efd4eee33 100644
--- a/libc/shared/rpc.h
+++ b/libc/shared/rpc.h
@@ -275,7 +275,7 @@ template <bool Invert> struct Process {
}
};
-/// Invokes a function accross every active buffer across the total lane size.
+/// Invokes a function across every active buffer across the total lane size.
template <typename F>
RPC_ATTRS static void invoke_rpc(F &&fn, uint32_t lane_size, uint64_t lane_mask,
Buffer *slot) {
@@ -375,8 +375,8 @@ struct Server {
uint32_t start = 0);
RPC_ATTRS Port open(uint32_t lane_size);
- RPC_ATTRS static uint64_t allocation_size(uint32_t lane_size,
- uint32_t port_count) {
+ RPC_ATTRS static constexpr uint64_t allocation_size(uint32_t lane_size,
+ uint32_t port_count) {
return Process<true>::allocation_size(port_count, lane_size);
}
More information about the libc-commits
mailing list