!lheuhImcToQZYTQTuI:nixos.org

Nix on macOS

1181 Members
“There are still many issues with the Darwin platform but most of it is quite usable.” — http://yves.gnu-darwin.org194 Servers

You have reached the beginning of time (for this room).


SenderMessageTime
29 Dec 2025
@emilazy:matrix.orgemily I think what would be ideal is #define _DARWIN_UNLIMITED_SELECT just in this file and doing it as a heap allocation 01:05:38
@ihar.hrachyshka:matrix.orgIhar Hrachyshkaok. should I add an explicit nfds check against SET_FDSIZE in that g_poll implementation? would it save runtime?01:06:07
@emilazy:matrix.orgemily of a struct { int32_t fds_bits[]; } 01:06:13
@emilazy:matrix.orgemilyyeah that would also work as a cheaper fix01:06:40
@emilazy:matrix.orgemilybut it should only be a few lines to do the heap allocation thing01:06:45
@emilazy:matrix.orgemilysomething like…01:08:49
@emilazy:matrix.orgemily
  fd_set rset_stack, wset_stack, xset_stack;
  fd_set *rset = &rset_stack, *wset = &wset_stack, *xset = &xset_stack;

  if (nfds > FD_SETSIZE)
    {
      size_t nelems = __DARWIN_howmany(nfds, __DARWIN_NFDBITS);
      size_t size = sizeof (struct { int32_t fds_bits[nelems] });
      rset = g_malloc0 (size);
      wset = g_malloc0 (size);
      xset = g_malloc0 (size);
    }

  …

  if (nfds > FD_SETSIZE)
    {
      g_free (rset);
      g_free (wset);
      g_free (xset);
    }
01:12:50
@emilazy:matrix.orgemily (I guess can g_malloc rather than g_malloc0, since FD_ZERO and all) 01:13:41
@emilazy:matrix.orgemily thankfully guint is small enough that you don't have to worry about size overflow 🫣 01:14:42

Show newer messages


Back to Room ListRoom Version: 6