2006-11-23 19:42:39 -05:00
|
|
|
|
2007-04-30 00:50:10 -04:00
|
|
|
(library (ikarus collect)
|
2007-05-05 02:07:50 -04:00
|
|
|
(export do-overflow do-overflow-words do-vararg-overflow collect
|
2007-08-30 22:09:13 -04:00
|
|
|
do-stack-overflow collect-key)
|
2007-05-06 18:00:49 -04:00
|
|
|
(import
|
2007-08-30 22:09:13 -04:00
|
|
|
(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)))
|
|
|
|
|
2007-05-05 02:07:50 -04:00
|
|
|
(define do-overflow-words
|
2006-11-23 19:42:39 -05:00
|
|
|
(lambda (n)
|
|
|
|
(foreign-call "ik_collect" ($fxsll n 2))
|
|
|
|
(void)))
|
|
|
|
|
2007-05-05 02:07:50 -04:00
|
|
|
(define do-vararg-overflow
|
2006-11-23 19:42:39 -05:00
|
|
|
(lambda (n)
|
|
|
|
(foreign-call "ik_collect_vararg" n)
|
|
|
|
(void)))
|
|
|
|
|
2007-05-05 02:07:50 -04:00
|
|
|
(define collect
|
2006-11-23 19:42:39 -05:00
|
|
|
(lambda ()
|
|
|
|
(do-overflow 4096)))
|
|
|
|
|
2007-05-05 02:07:50 -04:00
|
|
|
(define do-stack-overflow
|
2006-11-23 19:42:39 -05:00
|
|
|
(lambda ()
|
|
|
|
(foreign-call "ik_stack_overflow")))
|
|
|
|
|
2007-05-05 02:07:50 -04:00
|
|
|
(define dump-metatable
|
2006-11-23 19:42:39 -05:00
|
|
|
(lambda ()
|
|
|
|
(foreign-call "ik_dump_metatable")))
|
|
|
|
|
2007-05-05 02:07:50 -04:00
|
|
|
(define dump-dirty-vector
|
2006-11-23 19:42:39 -05:00
|
|
|
(lambda ()
|
|
|
|
(foreign-call "ik_dump_dirty_vector")))
|
2007-08-30 22:09:13 -04:00
|
|
|
|
|
|
|
(define (collect-key)
|
|
|
|
(or ($collect-key)
|
|
|
|
(begin
|
2007-09-01 16:09:56 -04:00
|
|
|
($collect-key (gensym))
|
2007-08-30 22:09:13 -04:00
|
|
|
(collect-key))))
|
|
|
|
|
2007-04-30 00:50:10 -04:00
|
|
|
)
|