From: Chris Hanson Date: Thu, 7 Jan 1993 23:53:55 +0000 (+0000) Subject: Added new primitives: PRIMITIVE-GET-FREE, PRIMITIVE-INCREMENT-FREE, X-Git-Tag: 20090517-FFI~8625 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=ddefb926ae22a80880dd769c4233388a4e04bd37;p=mit-scheme.git Added new primitives: PRIMITIVE-GET-FREE, PRIMITIVE-INCREMENT-FREE, HEAP-AVAILABLE?. --- diff --git a/v7/src/microcode/sysprim.c b/v7/src/microcode/sysprim.c index bf42817fd..385c178cb 100644 --- a/v7/src/microcode/sysprim.c +++ b/v7/src/microcode/sysprim.c @@ -1,8 +1,8 @@ /* -*-C-*- -$Id: sysprim.c,v 9.37 1992/10/17 20:43:12 jinx Exp $ +$Id: sysprim.c,v 9.38 1993/01/07 23:53:46 cph Exp $ -Copyright (c) 1987-1992 Massachusetts Institute of Technology +Copyright (c) 1987-1993 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -71,6 +71,42 @@ DEFINE_PRIMITIVE ("UNDER-EMACS?", Prim_under_emacs_p, 0, 0, 0) PRIMITIVE_RETURN (BOOLEAN_TO_OBJECT (OS_under_emacs_p ())); } +DEFINE_PRIMITIVE ("SET-TRAP-STATE!", Prim_set_trap_state, 1, 1, 0) +{ + long result; + extern long OS_set_trap_state(); + PRIMITIVE_HEADER (1); + + result = (OS_set_trap_state (arg_nonnegative_integer (1))); + if (result < 0) + { + error_bad_range_arg (1); + /*NOTREACHED*/ + } + PRIMITIVE_RETURN (LONG_TO_UNSIGNED_FIXNUM (result)); +} + +DEFINE_PRIMITIVE ("HEAP-AVAILABLE?", Prim_heap_available_p, 1, 1, 0) +{ + PRIMITIVE_HEADER (1); + PRIMITIVE_RETURN + (BOOLEAN_TO_OBJECT ((Free + (arg_nonnegative_integer (1))) < MemTop)); +} + +DEFINE_PRIMITIVE ("PRIMITIVE-GET-FREE", Prim_get_free, 1, 1, 0) +{ + PRIMITIVE_HEADER (1); + PRIMITIVE_RETURN + (MAKE_POINTER_OBJECT ((arg_index_integer (1, (MAX_TYPE_CODE + 1))), Free)); +} + +DEFINE_PRIMITIVE ("PRIMITIVE-INCREMENT-FREE", Prim_increment_free, 1, 1, 0) +{ + PRIMITIVE_HEADER (1); + Free += (arg_nonnegative_integer (1)); + PRIMITIVE_RETURN (UNSPECIFIC); +} + #define CONVERT_ADDRESS(address) \ (long_to_integer (ADDRESS_TO_DATUM (address))) @@ -123,18 +159,3 @@ DEFINE_PRIMITIVE ("GC-SPACE-STATUS", Prim_gc_space_status, 0, 0, 0) #endif /* USE_STACKLETS */ PRIMITIVE_RETURN (result); } - -DEFINE_PRIMITIVE ("SET-TRAP-STATE!", Prim_set_trap_state, 1, 1, 0) -{ - long result; - extern long OS_set_trap_state(); - PRIMITIVE_HEADER (1); - - result = (OS_set_trap_state (arg_nonnegative_integer (1))); - if (result < 0) - { - error_bad_range_arg (1); - /*NOTREACHED*/ - } - PRIMITIVE_RETURN (LONG_TO_UNSIGNED_FIXNUM (result)); -} diff --git a/v7/src/microcode/version.h b/v7/src/microcode/version.h index 9287a6256..707dcde42 100644 --- a/v7/src/microcode/version.h +++ b/v7/src/microcode/version.h @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: version.h,v 11.124 1992/12/28 21:54:43 cph Exp $ +$Id: version.h,v 11.125 1993/01/07 23:53:55 cph Exp $ Copyright (c) 1988-1992 Massachusetts Institute of Technology @@ -46,5 +46,5 @@ MIT in each case. */ #define VERSION 11 #endif #ifndef SUBVERSION -#define SUBVERSION 124 +#define SUBVERSION 125 #endif diff --git a/v8/src/microcode/version.h b/v8/src/microcode/version.h index 9287a6256..707dcde42 100644 --- a/v8/src/microcode/version.h +++ b/v8/src/microcode/version.h @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: version.h,v 11.124 1992/12/28 21:54:43 cph Exp $ +$Id: version.h,v 11.125 1993/01/07 23:53:55 cph Exp $ Copyright (c) 1988-1992 Massachusetts Institute of Technology @@ -46,5 +46,5 @@ MIT in each case. */ #define VERSION 11 #endif #ifndef SUBVERSION -#define SUBVERSION 124 +#define SUBVERSION 125 #endif