From 56f79491c41e251cc35fb1c1bc9c8ec5f2d6b0da Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Wed, 26 Mar 2014 10:35:53 +0100 Subject: [PATCH] Adapt test-out-of-memory to work on 32-bit systems * test-suite/standalone/test-out-of-memory (*limit*): Reduce limit to 50 MB. Adapt vector test to avoid exceeding maximum vector size on 32-bit systems. --- test-suite/standalone/test-out-of-memory | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test-suite/standalone/test-out-of-memory b/test-suite/standalone/test-out-of-memory index 0fc5a2e9e..bf55a4113 100755 --- a/test-suite/standalone/test-out-of-memory +++ b/test-suite/standalone/test-out-of-memory @@ -17,8 +17,8 @@ exec guile -q -s "$0" "$@" (write "Skipping test.\n" (current-error-port)) (exit 0))) -;; 100 MB. -(define *limit* (* 100 1024 1024)) +;; 50 MB. +(define *limit* (* 50 1024 1024)) (call-with-values (lambda () (getrlimit 'as)) (lambda (soft hard) @@ -36,8 +36,10 @@ exec guile -q -s "$0" "$@" (use-modules (rnrs bytevectors)) (test (lambda () - ;; A vector with a billion elements doesn't fit into 100 MB. - (make-vector #e1e9))) + ;; Unhappily, on 32-bit systems, vectors are limited to 16M + ;; elements. Boo. Anyway, a vector with 16M elements takes 64 + ;; MB, which doesn't fit into 50 MB. + (make-vector (1- (ash 1 24))))) (test (lambda () ;; Likewise for a bytevector. This is different from the above, ;; as the elements of a bytevector are not traced by GC.