Ian Lance Taylor <[email protected]> writes:
> 
> I don't know all the details here, but scavChunkData packs into a
> 64-bit value (see the pack method). That is useful because that 64-bit
> value can be loaded and stored atomically. It works out that there are
> only six bits available for scavChunkFlags, as the comment says. So a
> 10-bit counter isn't available.
> 
> Ian

Thanks very much, but I also found the layout of scanChunkData is like:
| 10-bit [inUse] + 6-bit unused  |  10-bit [lastInUse] + 6-bit [scavChunkFlag]  
|  32 bit [gen]  |
And actually we have 12-bit left besides inUse/lastInUse/gen.

```go
// pack returns sc packed into a uint64.
func (sc scavChunkData) pack() uint64 {
        return uint64(sc.inUse) |
                (uint64(sc.lastInUse) << 16) |
                (uint64(sc.scavChunkFlags) << (16 + logScavChunkInUseMax)) |
                (uint64(sc.gen) << 32)
}
```

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/golang-nuts/F8544CC6-1F76-4F1F-8318-5C4FD8717418%40gmail.com.

Reply via email to