Skip to content

Commit a03e329

Browse files
authored
flambda-backend: Make lazy.ml independent of the runtime version (#2080)
1 parent 8d71c28 commit a03e329

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

stdlib/lazy.ml

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ type 'a t = 'a CamlinternalLazy.t
5757
exception Undefined = CamlinternalLazy.Undefined
5858
external make_forward : 'a -> 'a lazy_t = "caml_lazy_make_forward"
5959
external force : 'a t -> 'a = "%lazy_force"
60-
external runtime5 : unit -> bool = "%runtime5"
61-
let runtime5 = runtime5 ()
6260

6361
let force_val l = CamlinternalLazy.force_gen ~only_val:true l
6462

@@ -67,7 +65,7 @@ let from_fun (f : unit -> 'arg) =
6765
Obj.set_field x 0 (Obj.repr f);
6866
(Obj.obj x : 'arg t)
6967

70-
let from_val4 (v : 'arg) =
68+
let from_val (v : 'arg) =
7169
let t = Obj.tag (Obj.repr v) in
7270
if t = Obj.forward_tag || t = Obj.lazy_tag ||
7371
t = Obj.forcing_tag || t = Obj.double_tag then begin
@@ -76,18 +74,6 @@ let from_val4 (v : 'arg) =
7674
(Obj.magic v : 'arg t)
7775
end
7876

79-
let from_val5 (v : 'arg) =
80-
let t = Obj.tag (Obj.repr v) in
81-
if t = Obj.forward_tag || t = Obj.lazy_tag
82-
|| t = Obj.forcing_tag
83-
|| t = Obj.double_tag then begin
84-
make_forward v
85-
end else begin
86-
(Obj.magic v : 'arg t)
87-
end
88-
89-
let from_val = if runtime5 then from_val5 else from_val4
90-
9177
let is_val (l : 'arg t) = Obj.tag (Obj.repr l) <> Obj.lazy_tag
9278

9379
let map f x =

0 commit comments

Comments
 (0)