Skip to content

Commit 06c189a

Browse files
authored
flambda-backend: Make stack allocation the default (ocaml-flambda#1013)
1 parent 98debd5 commit 06c189a

File tree

5 files changed

+14
-13
lines changed

5 files changed

+14
-13
lines changed

configure

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

+3-3
Original file line numberDiff line numberDiff line change
@@ -2035,10 +2035,10 @@ AS_IF([test x"$DEFAULT_STRING" = "xunsafe"],
20352035
[default_safe_string=false],
20362036
[default_safe_string=true])
20372037

2038-
AS_IF([test x"$enable_stack_allocation" = "xyes"],
2038+
AS_IF([test x"$enable_stack_allocation" = "xno"],
2039+
[stack_allocation=false],
20392040
[AC_DEFINE([STACK_ALLOCATION])
2040-
stack_allocation=true],
2041-
[stack_allocation=false])
2041+
stack_allocation=true])
20422042

20432043
AS_IF([test x"$enable_poll_insertion" = "xyes"],
20442044
[AC_DEFINE([POLL_INSERTION])

testsuite/tests/typing-local/loop_regions.ml

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
*)
99

1010
external local_stack_offset : unit -> int = "caml_local_stack_offset"
11+
let local_stack_offset () = local_stack_offset () / (Sys.word_size / 8)
1112
external opaque_local : ('a[@local_opt]) -> ('a[@local_opt]) = "%opaque"
1213

1314
let print_offsets (name,allocs) =
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
local for: [0; 16; 16]
2-
non-local for: [0; 16; 0]
3-
local while body: [0; 16; 16]
4-
nonlocal while body: [0; 16; 0]
5-
local while cond: [0; 16; 16]
6-
nonlocal while cond: [0; 16; 0]
1+
local for: [0; 2; 2]
2+
non-local for: [0; 2; 0]
3+
local while body: [0; 2; 2]
4+
nonlocal while body: [0; 2; 0]
5+
local while cond: [0; 2; 2]
6+
nonlocal while cond: [0; 2; 0]

testsuite/tests/typing-local/pr902.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ let () =
2828
let p = to_be_overapplied () () () 42 () in
2929
let end_offset = local_stack_offset () in
3030
assert (is_local p);
31-
let ok = end_offset - start_offset = 64 in
31+
let ok = end_offset - start_offset = Sys.word_size (* eight words *) in
3232
Printf.printf "PR902: %s\n" (if ok then "ok" else "FAIL")

0 commit comments

Comments
 (0)