MCPcopy
hub / github.com/etcd-io/bbolt / page

Method page

db.go:1130–1133  ·  view source on GitHub ↗

page retrieves a page reference from the mmap based on the current page size.

(id common.Pgid)

Source from the content-addressed store, hash-verified

1128
1129// page retrieves a page reference from the mmap based on the current page size.
1130func (db *DB) page(id common.Pgid) *common.Page {
1131 pos := id * common.Pgid(db.pageSize)
1132 return (*common.Page)(unsafe.Pointer(&db.data[pos]))
1133}
1134
1135// pageInBuffer retrieves a page reference from a given byte array based on the current page size.
1136func (db *DB) pageInBuffer(b []byte, id common.Pgid) *common.Page {

Callers 2

loadFreelistMethod · 0.95
mmapMethod · 0.95

Calls 1

PgidTypeAlias · 0.92

Tested by

no test coverage detected