Added new primitives: PRIMITIVE-GET-FREE, PRIMITIVE-INCREMENT-FREE,
authorChris Hanson <org/chris-hanson/cph>
Thu, 7 Jan 1993 23:53:55 +0000 (23:53 +0000)
committerChris Hanson <org/chris-hanson/cph>
Thu, 7 Jan 1993 23:53:55 +0000 (23:53 +0000)
HEAP-AVAILABLE?.

v7/src/microcode/sysprim.c
v7/src/microcode/version.h
v8/src/microcode/version.h

index bf42817fd964a9242e30ed652b7c8386603ce858..385c178cb42c68d9d37cb339a5dababe053566eb 100644 (file)
@@ -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);
+}
+\f
 #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));
-}
index 9287a625657c3bf07343705425fbb12c10653264..707dcde421f64e65297292f3235fe5f22f8809ce 100644 (file)
@@ -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
index 9287a625657c3bf07343705425fbb12c10653264..707dcde421f64e65297292f3235fe5f22f8809ce 100644 (file)
@@ -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