Skip to content

Commit a4b04d5

Browse files
mshinwellpoechsel
authored andcommitted
flambda-backend: inline never on Gc.create_alarm (oxcaml#56)
1 parent cef0bb6 commit a4b04d5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

stdlib/gc.ml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,9 @@ let rec call_alarm arec =
120120
end
121121

122122

123-
let create_alarm f =
123+
(* We use [@inline never] to ensure [arec] is never statically allocated
124+
(which would prevent installation of the finaliser). *)
125+
let [@inline never] create_alarm f =
124126
let arec = { active = ref true; f = f } in
125127
finalise call_alarm arec;
126128
arec.active

0 commit comments

Comments
 (0)