mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 11:40:18 +02:00
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.
This commit is contained in:
parent
63b9e8b03f
commit
56f79491c4
1 changed files with 6 additions and 4 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue