MCPcopy
hub / github.com/coocood/freecache / insertEntryPtr

Method insertEntryPtr

segment.go:369–380  ·  view source on GitHub ↗
(slotId uint8, hash16 uint16, offset int64, idx int, keyLen uint16)

Source from the content-addressed store, hash-verified

367}
368
369func (seg *segment) insertEntryPtr(slotId uint8, hash16 uint16, offset int64, idx int, keyLen uint16) {
370 if seg.slotLens[slotId] == seg.slotCap {
371 seg.expand()
372 }
373 seg.slotLens[slotId]++
374 atomic.AddInt64(&seg.entryCount, 1)
375 slot := seg.getSlot(slotId)
376 copy(slot[idx+1:], slot[idx:])
377 slot[idx].offset = offset
378 slot[idx].hash16 = hash16
379 slot[idx].keyLen = keyLen
380}
381
382func (seg *segment) delEntryPtrByOffset(slotId uint8, hash16 uint16, offset int64) {
383 slot := seg.getSlot(slotId)

Callers 1

setMethod · 0.95

Calls 2

expandMethod · 0.95
getSlotMethod · 0.95

Tested by

no test coverage detected