| 367 | } |
| 368 | |
| 369 | func (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 | |
| 382 | func (seg *segment) delEntryPtrByOffset(slotId uint8, hash16 uint16, offset int64) { |
| 383 | slot := seg.getSlot(slotId) |