[ruby-cvs:73160] normal:r66060 (trunk): io.c (rb_update_max_fd): use F_GETFL if possible

normal at ruby-lang.org normal at ruby-lang.org
Wed Nov 28 10:10:40 JST 2018

normal	2018-11-28 10:10:40 +0900 (Wed, 28 Nov 2018)

  New Revision: 66060


    io.c (rb_update_max_fd): use F_GETFL if possible
    On 64-bit Linux, fstat() needs to fill out a 144 byte struct
    while F_GETFL only needs to return 8 bytes.
    Fwiw, F_GETFD requires an additional rcu_read_lock and bitmap
    check; so it's obviously more expensive than F_GETFL on Linux.
    Reduce stack usage of rb_update_max_fd from 184 to 24 bytes.

  Modified files:

More information about the ruby-cvs mailing list