aboutsummaryrefslogtreecommitdiff
path: root/bnode.go
blob: 3ad4f5820a0eccb53a323ea1caa4c477e105ac4b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package bolt

import (
	"unsafe"
)

const bnodeSize = int(unsafe.Sizeof(lnode{}))

// bnode represents a node on a branch page.
type bnode struct {
	pos   uint32
	ksize uint32
	pgid  pgid
}

// key returns a byte slice of the node key.
func (n *bnode) key() []byte {
	buf := (*[maxAllocSize]byte)(unsafe.Pointer(n))
	return buf[n.pos : n.pos+n.ksize]
}