ikarus/src/ikarus.collect.ss

48 lines
936 B
Scheme
Raw Normal View History

2006-11-23 19:42:39 -05:00
2007-04-30 00:50:10 -04:00
(library (ikarus collect)
(export do-overflow do-overflow-words do-vararg-overflow collect
do-stack-overflow collect-key)
(import
(except (ikarus) collect collect-key)
(ikarus system $fx)
(ikarus system $arg-list))
2006-11-23 19:42:39 -05:00
2007-04-30 00:50:10 -04:00
(define do-overflow
2006-11-23 19:42:39 -05:00
(lambda (n)
(foreign-call "ik_collect" n)
(void)))
(define do-overflow-words
2006-11-23 19:42:39 -05:00
(lambda (n)
(foreign-call "ik_collect" ($fxsll n 2))
(void)))
(define do-vararg-overflow
2006-11-23 19:42:39 -05:00
(lambda (n)
(foreign-call "ik_collect_vararg" n)
(void)))
(define collect
2006-11-23 19:42:39 -05:00
(lambda ()
(do-overflow 4096)))
(define do-stack-overflow
2006-11-23 19:42:39 -05:00
(lambda ()
(foreign-call "ik_stack_overflow")))
(define dump-metatable
2006-11-23 19:42:39 -05:00
(lambda ()
(foreign-call "ik_dump_metatable")))
(define dump-dirty-vector
2006-11-23 19:42:39 -05:00
(lambda ()
(foreign-call "ik_dump_dirty_vector")))
(define (collect-key)
(or ($collect-key)
(begin
2007-09-01 16:09:56 -04:00
($collect-key (gensym))
(collect-key))))
2007-04-30 00:50:10 -04:00
)