[libc-commits] [PATCH] D153304: [libc] Remove flexible array and replace with a template

Jon Chesterfield via Phabricator via libc-commits libc-commits at lists.llvm.org
Tue Jun 20 13:14:00 PDT 2023


JonChesterfield accepted this revision.
JonChesterfield added a comment.
This revision is now accepted and ready to land.

I think this is alright to be honest. It does something subtle fairly cleanly.



================
Comment at: libc/utils/gpu/server/Server.cpp:221
+
+  if (!state->devices[device_id]) {
+    if (lane_size == 1)
----------------
switch?


================
Comment at: libc/utils/gpu/server/Server.cpp:235
+
+  uint64_t size = state->devices[device_id]->server.allocation_size(num_ports);
+  void *buffer = alloc(size, data);
----------------
we might move allocation_size to a free function at some point, it doesn't really need to be templated on lane size


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D153304



More information about the libc-commits mailing list