mirror of
https://github.com/luxfi/zapdb.git
synced 2026-07-27 06:54:45 +00:00
Rename Skiplist::Size to MemSize
This commit is contained in:
@@ -981,7 +981,7 @@ func (s *KV) ensureRoomForWrite() error {
|
||||
var err error
|
||||
s.Lock()
|
||||
defer s.Unlock()
|
||||
if s.mt.Size() < s.opt.MaxTableSize {
|
||||
if s.mt.MemSize() < s.opt.MaxTableSize {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -996,7 +996,7 @@ func (s *KV) ensureRoomForWrite() error {
|
||||
}
|
||||
|
||||
s.elog.Printf("Flushing memtable, mt.size=%d size of flushChan: %d\n",
|
||||
s.mt.Size(), len(s.flushChan))
|
||||
s.mt.MemSize(), len(s.flushChan))
|
||||
// We manage to push this task. Let's modify imm.
|
||||
s.imm = append(s.imm, s.mt)
|
||||
s.mt = skl.NewSkiplist(arenaSize(&s.opt))
|
||||
|
||||
+3
-1
@@ -385,7 +385,9 @@ func (s *Skiplist) NewIterator() *Iterator {
|
||||
return &Iterator{list: s}
|
||||
}
|
||||
|
||||
func (s *Skiplist) Size() int64 { return s.arena.Size() }
|
||||
// MemSize returns the size of the Skiplist in terms of how much memory is used within its internal
|
||||
// arena.
|
||||
func (s *Skiplist) MemSize() int64 { return s.arena.Size() }
|
||||
|
||||
// Iterator is an iterator over skiplist object. For new objects, you just
|
||||
// need to initialize Iterator.list.
|
||||
|
||||
Reference in New Issue
Block a user