racket/collects/tests/racket/runaway-place.rkt
Matthew Flatt 6d944453a7 make memory accounting and places work together
The `current-memory-use' function's result now includes the memory
use of places created from the calling place, and custodian memory
limits apply to memory use by places (owned by the custodian).

This change is relevant to PR 12004 in that DrRacket will no longer
crash on the example if a memory limit is in effect, but plain
Racket starts with no such limit and will exhaust all memory.
2011-09-05 13:24:22 -06:00

17 lines
398 B
Racket

#lang racket/base
(require racket/place)
(provide main runaway)
(define (main)
(parameterize ([current-custodian (make-custodian)])
(custodian-limit-memory (current-custodian) (* 1024 1024 64))
(parameterize ([current-custodian (make-custodian)])
(place-wait (place ch (runaway))))))
(define (runaway)
(printf "starting\n")
(define p (place ch (runaway)))
(place-wait p))