[ruby-cvs:71084] normal:r63993 (trunk): zlib (rb_gzreader_getc): localize and return cbuf directly

normal at ruby-lang.org normal at ruby-lang.org
Wed Jul 18 17:16:18 JST 2018


normal	2018-07-18 17:16:18 +0900 (Wed, 18 Jul 2018)

  New Revision: 63993

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63993

  Log:
    zlib (rb_gzreader_getc): localize and return cbuf directly
    
    No point in having a long-lived cbuf in "struct gzfile"
    since GZFILE_CBUF_CAPA is smaller than RSTRING_EMBED_LEN_MAX
    (even on 32-bit).  We can also have rb_econv_convert write
    directly to the return value instead of an intermediate buffer.
    
    This brings "struct gzfile" from 264 to 256 bytes on 64-bit
    systems to avoid taking an additional cache line.

  Modified files:
    trunk/ext/zlib/zlib.c


More information about the ruby-cvs mailing list