// Primitive function to implement the LISP51 // SET-GC-LIMIT function. // // File: p_sgclim.cc // Author: course // Version: 1 #include "lisp.h" #include "gc.h" // set-gc-limit -- takes one integer argument ? 0 and // sets the gc limit to it // object * prim_set_gc_limit (object * arglist) { if (length (arglist) != 1) error ( "SET-GC-LIMIT: One argument" " expected: ", arglist ); fixnum * fxarg = may_be_fixnum (unchecked_car (arglist)); if ( ! fxarg || value (fxarg) <= 0 ) error ( "SET-GC-LIMIT: argument must be" " integer > 0: ", arglist ); set_gc_limit (value (fxarg)); return (fxarg); }