// NewCursor creates a C cursor from a Bucket. func NewCursor(b *bolt.Bucket) *Cursor { info := b.Tx().DB().Info() root := b.Root() c := &Cursor{C: new(C.bolt_cursor)} C.bolt_cursor_init(c.C, unsafe.Pointer(&info.Data[0]), C.size_t(info.PageSize), C.pgid(root)) return c }