branch: externals/vlf
commit a7be7136be36c3f6114db6cb618a08c99137d174
Author: Andrey Kotlarski <[email protected]>
Commit: Andrey Kotlarski <[email protected]>

    Set vlf-tune-max with proper value in case RAM size is wrongly
    determined.
---
 vlf-tune.el | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/vlf-tune.el b/vlf-tune.el
index 9fbc3d7..a17cbc8 100644
--- a/vlf-tune.el
+++ b/vlf-tune.el
@@ -56,10 +56,11 @@ but don't change batch size.  If t, measure and change."
             (* 1000 (string-to-number (substring free match-from
                                                  (match-end 0))))))))
 
-(defcustom vlf-tune-max (let ((ram-size (vlf-tune-ram-size)))
-                          (if ram-size
-                              (/ ram-size 20)
-                            large-file-warning-threshold))
+(defcustom vlf-tune-max (max (let ((ram-size (vlf-tune-ram-size)))
+                               (if ram-size
+                                   (/ ram-size 20)
+                                 0))
+                             large-file-warning-threshold)
   "Maximum batch size in bytes when auto tuning.
 Avoid increasing this after opening file with VLF."
   :group 'vlf :type 'integer)

Reply via email to