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

Method addSpan

internal/freelist/hashmap.go:152–161  ·  view source on GitHub ↗
(start common.Pgid, size uint64)

Source from the content-addressed store, hash-verified

150}
151
152func (f *hashMap) addSpan(start common.Pgid, size uint64) {
153 f.backwardMap[start-1+common.Pgid(size)] = size
154 f.forwardMap[start] = size
155 if _, ok := f.freemaps[size]; !ok {
156 f.freemaps[size] = make(map[common.Pgid]struct{})
157 }
158
159 f.freemaps[size][start] = struct{}{}
160 f.freePagesCount += size
161}
162
163func (f *hashMap) delSpan(start common.Pgid, size uint64) {
164 delete(f.forwardMap, start)

Callers 3

InitMethod · 0.95
AllocateMethod · 0.95
mergeWithExistingSpanMethod · 0.95

Calls 1

PgidTypeAlias · 0.92

Tested by

no test coverage detected