[dev.garbage] runtime: logic that uses count trailing zero (ctz)
[dev.garbage] runtime: logic that uses count trailing zero (ctz)

Most (all?) processors that Go supports supply a hardware
instruction that takes a byte and returns the number
of zeros trailing the first 1 encountered, or 8
if no ones are found. This is the index within the
byte of the first 1 encountered. CTZ should improve the
performance of the nextFreeIndex function.

Since nextFreeIndex wants the next unmarked (0) bit
a bit-wise complement is needed before calling ctz.
Furthermore unmarked bits associated with previously
allocated objects need to be ignored. Instead of writing
a 1 as we allocate the code masks all bits less than the
freeindex after loading the byte.

While this CL does not actual execute a CTZ instruction
it supplies a ctz function with the appropiate signature
along with the logic to execute it.

Change-Id: I5c55ce0ed48ca22c21c4dd9f969b0819b4eadaa7
Reviewed-on: https://go-review.googlesource.com/20169
Reviewed-by: Keith Randall <8c99c3a9284e493be632950b84cd789d08ed3e9d@golang.org>
Reviewed-by: Austin Clements <7ea35d812706d9213868749011af1ed4fa2f6aa0@google.com>

momchil-velikov/go,josharian/go,nawawi/go,akutz/go,nawawi/go,akutz/go,momchil-velikov/go,codestation/go,polyverse-security/go,polyverse-security/go,goodlang/good,ganboing/go-esx,suncycheng/go,ImJasonH/go,nawawi/go,momchil-velikov/go,ImJasonH/go,josharian/go,codestation/go,cloudflare/go,golang/go,cloudflare/go,polyverse-security/go,4ad/go,CAFxX/go,codestation/go,Cofyc/go,goodlang/good,golang/go,josharian/go,akutz/go,nawawi/go,nawawi/go,cloudflare/go,goodlang/good,CAFxX/go,ImJasonH/go,derekmarcotte/go,linux-on-ibm-z/go,ganboing/go-esx,4ad/go,josharian/go,vsekhar/elastic-go,akutz/go,golang/go,vsekhar/elastic-go,ImJasonH/go,akutz/go,suncycheng/go,codestation/go,Cofyc/go,akutz/go,derekmarcotte/go,derekmarcotte/go,linux-on-ibm-z/go,Cofyc/go,polyverse-security/go,polyverse-security/go,suncycheng/go,4ad/go,derekmarcotte/go,momchil-velikov/go,cloudflare/go,polyverse-security/go,goodlang/good,Cofyc/go,goodlang/good,suncycheng/go,theif519/go,vsekhar/elastic-go,derekmarcotte/go,nawawi/go,suncycheng/go,golang/go,codestation/go,CAFxX/go,ganboing/go-esx,linux-on-ibm-z/go,CAFxX/go,CAFxX/go,golang/go,akutz/go,theif519/go,derekmarcotte/go,golang/go,josharian/go,ganboing/go-esx,4ad/go,ImJasonH/go,goodlang/good,linux-on-ibm-z/go,derekmarcotte/go,momchil-velikov/go,suncycheng/go,codestation/go,CAFxX/go,momchil-velikov/go,ImJasonH/go,josharian/go,4ad/go,theif519/go,theif519/go,akutz/go,vsekhar/elastic-go,ganboing/go-esx,nawawi/go,theif519/go,golang/go,vsekhar/elastic-go,josharian/go,4ad/go,cloudflare/go,vsekhar/elastic-go,CAFxX/go,ImJasonH/go,derekmarcotte/go,codestation/go,cloudflare/go,momchil-velikov/go,linux-on-ibm-z/go,suncycheng/go,ganboing/go-esx,vsekhar/elastic-go,ganboing/go-esx,linux-on-ibm-z/go,nawawi/go,theif519/go,josharian/go,goodlang/good,ganboing/go-esx,cloudflare/go,Cofyc/go,Cofyc/go,linux-on-ibm-z/go,polyverse-security/go,vsekhar/elastic-go,CAFxX/go,goodlang/good,Cofyc/go,codestation/go,theif519/go,ImJasonH/go,momchil-velikov/go,Cofyc/go,linux-on-ibm-z/go,christopher-henderson/Go,polyverse-security/go,4ad/go,theif519/go,cloudflare/go,golang/go,4ad/go,suncycheng/go