shows total memory usage

This commit is contained in:
Marcos Diez
2019-06-06 09:58:55 -03:00
committed by Bradley Cicenas
parent fae9deb1d9
commit 9bcf2c2c7a
3 changed files with 19 additions and 1 deletions

View File

@@ -17,6 +17,16 @@ type GridCursor struct {
func (gc *GridCursor) Len() int { return len(gc.filtered) }
func (gc *GridCursor) MemoryUsage() int64 {
var size int64
size = 0
for _, c := range gc.filtered {
size += c.MemUsage
}
gc.Reset()
return size
}
func (gc *GridCursor) Selected() *container.Container {
idx := gc.Idx()
if idx < gc.Len() {