Cyc-minor-gc is now part of (srfi 18)

It makes more sense here than as a primitive, since threading is the only place you would need to trigger this from application code.
This commit is contained in:
Justin Ethier 2016-01-18 22:40:59 -05:00
parent 92561abc85
commit 76bbca68e5
6 changed files with 9 additions and 14 deletions

View file

@ -233,7 +233,6 @@ extern const object primitive_Cyc_91cvar_127;
extern const object primitive_Cyc_91has_91cycle_127; extern const object primitive_Cyc_91has_91cycle_127;
extern const object primitive_Cyc_91spawn_91thread_67; extern const object primitive_Cyc_91spawn_91thread_67;
extern const object primitive_Cyc_91end_91thread_67; extern const object primitive_Cyc_91end_91thread_67;
extern const object primitive_Cyc_91minor_91gc;
extern const object primitive__87; extern const object primitive__87;
extern const object primitive__91; extern const object primitive__91;
extern const object primitive__85; extern const object primitive__85;

View file

@ -1783,8 +1783,6 @@ void _Cyc_91spawn_91thread_67(void *data, object cont, object args) {
void _Cyc_91end_91thread_67(void *data, object cont, object args) { void _Cyc_91end_91thread_67(void *data, object cont, object args) {
Cyc_end_thread((gc_thread_data *)data); Cyc_end_thread((gc_thread_data *)data);
return_closcall1(data, cont, boolean_f); } return_closcall1(data, cont, boolean_f); }
void _Cyc_91minor_91gc_primitive(void *data, object cont, object args){
Cyc_trigger_minor_gc(data, cont); }
void __87(void *data, object cont, object args) { void __87(void *data, object cont, object args) {
integer_type argc = Cyc_length(data, args); integer_type argc = Cyc_length(data, args);
dispatch(data, argc.value, (function_type)dispatch_sum, cont, cont, args); } dispatch(data, argc.value, (function_type)dispatch_sum, cont, cont, args); }
@ -2523,7 +2521,6 @@ static primitive_type Cyc_91cvar_127_primitive = {{0}, primitive_tag, "Cyc-cvar?
static primitive_type Cyc_91has_91cycle_127_primitive = {{0}, primitive_tag, "Cyc-has-cycle?", &_Cyc_91has_91cycle_127}; static primitive_type Cyc_91has_91cycle_127_primitive = {{0}, primitive_tag, "Cyc-has-cycle?", &_Cyc_91has_91cycle_127};
static primitive_type Cyc_91spawn_91thread_67_primitive = {{0}, primitive_tag, "Cyc-spawn-thread!", &_Cyc_91spawn_91thread_67}; static primitive_type Cyc_91spawn_91thread_67_primitive = {{0}, primitive_tag, "Cyc-spawn-thread!", &_Cyc_91spawn_91thread_67};
static primitive_type Cyc_91end_91thread_67_primitive = {{0}, primitive_tag, "Cyc-end-thread!", &_Cyc_91end_91thread_67}; static primitive_type Cyc_91end_91thread_67_primitive = {{0}, primitive_tag, "Cyc-end-thread!", &_Cyc_91end_91thread_67};
static primitive_type Cyc_91minor_91gc_primitive = {{0}, primitive_tag, "Cyc-minor-gc", &_Cyc_91minor_91gc_primitive};
static primitive_type _87_primitive = {{0}, primitive_tag, "+", &__87}; static primitive_type _87_primitive = {{0}, primitive_tag, "+", &__87};
static primitive_type _91_primitive = {{0}, primitive_tag, "-", &__91}; static primitive_type _91_primitive = {{0}, primitive_tag, "-", &__91};
static primitive_type _85_primitive = {{0}, primitive_tag, "*", &__85}; static primitive_type _85_primitive = {{0}, primitive_tag, "*", &__85};
@ -2647,7 +2644,6 @@ const object primitive_Cyc_91cvar_127 = &Cyc_91cvar_127_primitive;
const object primitive_Cyc_91has_91cycle_127 = &Cyc_91has_91cycle_127_primitive; const object primitive_Cyc_91has_91cycle_127 = &Cyc_91has_91cycle_127_primitive;
const object primitive_Cyc_91spawn_91thread_67 = &Cyc_91spawn_91thread_67_primitive; const object primitive_Cyc_91spawn_91thread_67 = &Cyc_91spawn_91thread_67_primitive;
const object primitive_Cyc_91end_91thread_67 = &Cyc_91end_91thread_67_primitive; const object primitive_Cyc_91end_91thread_67 = &Cyc_91end_91thread_67_primitive;
const object primitive_Cyc_91minor_91gc = &Cyc_91minor_91gc_primitive;
const object primitive__87 = &_87_primitive; const object primitive__87 = &_87_primitive;
const object primitive__91 = &_91_primitive; const object primitive__91 = &_91_primitive;
const object primitive__85 = &_85_primitive; const object primitive__85 = &_85_primitive;

View file

@ -540,7 +540,6 @@
((eq? p 'mutex?) "Cyc_is_mutex") ((eq? p 'mutex?) "Cyc_is_mutex")
((eq? p 'Cyc-installation-dir) "Cyc_installation_dir") ((eq? p 'Cyc-installation-dir) "Cyc_installation_dir")
((eq? p 'command-line-arguments) "Cyc_command_line_arguments") ((eq? p 'command-line-arguments) "Cyc_command_line_arguments")
((eq? p 'Cyc-minor-gc) "Cyc_trigger_minor_gc")
((eq? p 'system) "Cyc_system") ((eq? p 'system) "Cyc_system")
((eq? p 'assq) "assq") ((eq? p 'assq) "assq")
((eq? p 'assv) "assq") ((eq? p 'assv) "assq")
@ -626,7 +625,6 @@
mutex-unlock! mutex-unlock!
Cyc-installation-dir Cyc-installation-dir
command-line-arguments command-line-arguments
Cyc-minor-gc
assq assq
assv assv
assoc assoc
@ -665,7 +663,6 @@
((eq? p 'read-char) "object") ((eq? p 'read-char) "object")
((eq? p 'peek-char) "object") ((eq? p 'peek-char) "object")
((eq? p 'command-line-arguments) "object") ((eq? p 'command-line-arguments) "object")
((eq? p 'Cyc-minor-gc) "object")
((eq? p 'number->string) "object") ((eq? p 'number->string) "object")
((eq? p 'symbol->string) "object") ((eq? p 'symbol->string) "object")
((eq? p 'substring) "object") ((eq? p 'substring) "object")
@ -699,7 +696,6 @@
command-line-arguments command-line-arguments
;make-mutex ;make-mutex
mutex-lock! mutex-unlock! mutex-lock! mutex-unlock!
Cyc-minor-gc
Cyc-read-line Cyc-read-line
read-char peek-char read-char peek-char
cons length vector-length cell)))) cons length vector-length cell))))
@ -707,7 +703,7 @@
;; Pass continuation as the function's first parameter? ;; Pass continuation as the function's first parameter?
(define (prim:cont? exp) (define (prim:cont? exp)
(and (prim? exp) (and (prim? exp)
(member exp '(Cyc-read-line apply command-line-arguments Cyc-minor-gc number->string (member exp '(Cyc-read-line apply command-line-arguments number->string
read-char peek-char mutex-lock! read-char peek-char mutex-lock!
symbol->string list->string substring string-append symbol->string list->string substring string-append
make-vector list->vector Cyc-installation-dir)))) make-vector list->vector Cyc-installation-dir))))
@ -715,7 +711,7 @@
;; Primitive functions that pass a continuation or thread data but have no other arguments ;; Primitive functions that pass a continuation or thread data but have no other arguments
(define (prim:cont/no-args? exp) (define (prim:cont/no-args? exp)
(and (prim? exp) (and (prim? exp)
(member exp '(command-line-arguments make-mutex Cyc-minor-gc Cyc-current-exception-handler)))) (member exp '(command-line-arguments make-mutex Cyc-current-exception-handler))))
;; Pass an integer arg count as the function's first parameter? ;; Pass an integer arg count as the function's first parameter?
(define (prim:arg-count? exp) (define (prim:arg-count? exp)

View file

@ -454,7 +454,6 @@
Cyc-has-cycle? Cyc-has-cycle?
Cyc-spawn-thread! Cyc-spawn-thread!
Cyc-end-thread! Cyc-end-thread!
Cyc-minor-gc
Cyc-stdout Cyc-stdout
Cyc-stdin Cyc-stdin
Cyc-stderr Cyc-stderr
@ -564,7 +563,6 @@
Cyc-cvar? Cyc-cvar?
Cyc-spawn-thread! Cyc-spawn-thread!
Cyc-end-thread! Cyc-end-thread!
Cyc-minor-gc
apply apply
%halt %halt
exit exit

View file

@ -156,7 +156,6 @@
(list 'Cyc-installation-dir Cyc-installation-dir) (list 'Cyc-installation-dir Cyc-installation-dir)
(list 'system system) (list 'system system)
(list 'command-line-arguments command-line-arguments) (list 'command-line-arguments command-line-arguments)
(list 'Cyc-minor-gc Cyc-minor-gc)
(list 'error error) (list 'error error)
(list 'cons cons) (list 'cons cons)
(list 'cell-get cell-get) (list 'cell-get cell-get)

View file

@ -40,6 +40,7 @@
;; Non-standard functions: ;; Non-standard functions:
->heap ->heap
Cyc-minor-gc
) )
(begin (begin
;; Threading ;; Threading
@ -88,4 +89,10 @@
"(void *data, int argc, closure _, object k, object obj)" "(void *data, int argc, closure _, object k, object obj)"
" object heap_obj = copy2heap(data, obj); " object heap_obj = copy2heap(data, obj);
return_closcall1(data, k, heap_obj); ") return_closcall1(data, k, heap_obj); ")
;; Trigger a minor garbage collection.
;; This is potentially useful to evacuate all objects from
;; a thread's stack to the heap.
(define-c Cyc-minor-gc
"(void *data, int argc, closure _, object k)"
" Cyc_trigger_minor_gc(data, k); ")
)) ))