ruby-changes:52279
From: normal <ko1@a...>
Date: Tue, 21 Aug 2018 08:48:09 +0900 (JST)
Subject: [ruby-changes:52279] normal:r64487 (trunk): cont.c (struct rb_fiber_struct): bitfields for trasnferred and status
normal 2018-08-21 08:48:03 +0900 (Tue, 21 Aug 2018) New Revision: 64487 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64487 Log: cont.c (struct rb_fiber_struct): bitfields for trasnferred and status On 32-bit x86, this reduces the struct from 836 to 832 bytes and brings us down to 13 (64-byte) cachelines (from 14). Modified files: trunk/cont.c Index: cont.c =================================================================== --- cont.c (revision 64486) +++ cont.c (revision 64487) @@ -175,12 +175,12 @@ struct rb_fiber_struct { https://github.com/ruby/ruby/blob/trunk/cont.c#L175 rb_context_t cont; VALUE first_proc; struct rb_fiber_struct *prev; - enum fiber_status status; + BITFIELD(enum fiber_status status) : 2; /* If a fiber invokes "transfer", * then this fiber can't "resume" any more after that. * You shouldn't mix "transfer" and "resume". */ - int transferred; + unsigned int transferred : 1; #if FIBER_USE_NATIVE #ifdef _WIN32 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/