src/Pure/ML-Systems/polyml_common.ML
changeset 33060 e66b41782cb5
parent 33004 715566791eb0
child 33213 1b550123f133
--- a/src/Pure/ML-Systems/polyml_common.ML	Thu Oct 22 09:50:29 2009 +0200
+++ b/src/Pure/ML-Systems/polyml_common.ML	Thu Oct 22 15:19:44 2009 +0200
@@ -128,3 +128,12 @@
         val _ = RunCall.run_call1 RuntimeCalls.POLY_SYS_profiler 0;
       in Exn.release res end;
 
+
+(* magic immutability -- for internal use only! *)
+
+fun magic_immutability_mark (r: 'a Unsynchronized.ref) =
+  ignore (RunCall.run_call1 RuntimeCalls.POLY_SYS_lockseg r);
+
+fun magic_immutability_test (r: 'a Unsynchronized.ref) =
+  Word8.andb (0wx40, RunCall.run_call1 RuntimeCalls.POLY_SYS_get_flags r) = 0w0;
+