On Do, 21 Mär 2019, Bram Moolenaar wrote:
> Ah, that makes sense.  Although it makes me wonder if we need this value
> at all.  We can just remove "min" and everything works.

okay, so how about this then:
diff --git a/src/testdir/test_memory_usage.vim 
b/src/testdir/test_memory_usage.vim
index b70d2d03f..b387edc1a 100644
--- a/src/testdir/test_memory_usage.vim
+++ b/src/testdir/test_memory_usage.vim
@@ -36,15 +36,12 @@ func s:monitor_memory_usage(pid) abort
   let proc = {}
   let proc.pid = a:pid
   let proc.hist = []
-  let proc.min = 0
   let proc.max = 0

   func proc.op() abort
     " Check the last 200ms.
     let val = s:memory_usage(self.pid)
-    if self.min > val
-      let self.min = val
-    elseif self.max < val
+    if self.max < val
       let self.max = val
     endif
     call add(self.hist, val)
@@ -56,7 +53,7 @@ func s:monitor_memory_usage(pid) abort
   endfunc

   call WaitFor({-> proc.op()}, 10000)
-  return {'last': get(proc.hist, -1), 'min': proc.min, 'max': proc.max}
+  return {'last': get(proc.hist, -1), 'max': proc.max}
 endfunc

 let s:term_vim = {}

> When this fails, what are the values?  Perhaps this should also use
> assert_inrange()?

function RunTheTest[40]..Test_memory_func_capture_vargs line 24: 
Expected 17548 but got 17832

I am not sure why it is actually larger than expected. Also the test 
mentions:

,----
| " In this case, garbase collecting is not needed.
| call assert_equal(after.last, after.max)
`----

So max is larger than last. Does that mean, that garbage collection has 
already kicked in and released some memory?

Best,
Christian
-- 
Stell Dir vor es ist Frühling und kein Baum wird mehr grün.

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui