This code assumes that 16bit uint wrapping can be used, rather than masking by SLAB_SIZE-1. Add explicit mask, so we can change the SLAB_SIZE to be smaller.
History squashed from internal development. Internal history has commit hash: e27a0e485c44a5003a802de2661ce3b21e120316