Skip to content

Commit

Permalink
record: add unpack method annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
caicancai authored and RaduBerinde committed Sep 14, 2024
1 parent 139ee80 commit 51e08f0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion record/log_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,12 @@ type syncQueue struct {

const dequeueBits = 32

// unpack extracts the head and tail indices from a 64-bit unsigned integer.
func (q *syncQueue) unpack(ptrs uint64) (head, tail uint32) {
const mask = 1<<dequeueBits - 1
head = uint32((ptrs >> dequeueBits) & mask)
tail = uint32(ptrs & mask)
return
return head, tail
}

func (q *syncQueue) push(wg *sync.WaitGroup, err *error) {
Expand Down

0 comments on commit 51e08f0

Please sign in to comment.