MCPcopy
hub / github.com/dgraph-io/badger / Decode

Method Decode

structs.go:57–62  ·  view source on GitHub ↗

Decode decodes the value pointer into the provided byte buffer.

(b []byte)

Source from the content-addressed store, hash-verified

55
56// Decode decodes the value pointer into the provided byte buffer.
57func (p *valuePointer) Decode(b []byte) {
58 // Copy over data from b into p. Using *p=unsafe.pointer(...) leads to
59 // pointer alignment issues. See https://github.com/dgraph-io/badger/issues/1096
60 // and comment https://github.com/dgraph-io/badger/pull/1097#pullrequestreview-307361714
61 copy(((*[vptrSize]byte)(unsafe.Pointer(p))[:]), b[:vptrSize])
62}
63
64// header is used in value log as a header before Entry.
65type header struct {

Callers 12

rewriteMethod · 0.95
deleteMoveKeysForMethod · 0.95
populateDiscardStatsMethod · 0.95
OpenFunction · 0.95
buildL0TableFunction · 0.95
RunValueLogGCMethod · 0.95
TestForceFlushMemtableFunction · 0.95
AddMethod · 0.95
compactBuildTablesMethod · 0.95
yieldItemValueMethod · 0.95
EstimatedSizeMethod · 0.95
ValueSizeMethod · 0.95

Calls

no outgoing calls

Tested by 1

TestForceFlushMemtableFunction · 0.76