-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
flambda-backend: Wider scope of
in_minor_collection
(#2098)
* Make the check that custom finalisers do not trigger GC / thread switches apply even in the absence of systhreads * Add a test
- Loading branch information
Showing
8 changed files
with
48 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
(* TEST | ||
modules = "stub.c" | ||
* not-windows | ||
** native | ||
*) | ||
|
||
type t | ||
external alloc : unit -> t = "caml_test_alloc" | ||
|
||
let () = | ||
ignore (alloc()); | ||
Gc.minor() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
ulimit -c 0 | ||
(${program} > ${output}) 2>&1 | grep -q 'from inside minor GC' | ||
exit $? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#include <caml/custom.h> | ||
#include <caml/signals.h> | ||
|
||
static void caml_test_finalize(value v) | ||
{ | ||
caml_enter_blocking_section(); | ||
caml_leave_blocking_section(); | ||
} | ||
|
||
static struct custom_operations caml_test_ops = { | ||
"_test", | ||
caml_test_finalize, | ||
custom_compare_default, | ||
custom_hash_default, | ||
custom_serialize_default, | ||
custom_deserialize_default, | ||
custom_compare_ext_default, | ||
custom_fixed_length_default | ||
}; | ||
|
||
value caml_test_alloc(value unit) | ||
{ | ||
return caml_alloc_custom(&caml_test_ops, 0, 0, 1); | ||
} |