Skip to content

Commit 3dc3cd7

Browse files
authored
Remove expensive debug assertion from dynlink (#10184)
1 parent 50b237f commit 3dc3cd7

File tree

4 files changed

+10
-17
lines changed

4 files changed

+10
-17
lines changed

Changes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ Working version
9494
directory.
9595
(Nicolás Ojeda Bär, review by Gabriel Scherer and Xavier Leroy)
9696

97+
- #10184: Remove expensive debug assertion from dynlink.
98+
(Leo White, review by David Allsopp and Xavier Leroy)
99+
97100
- #10185: Consider that IPv6 is always enabled on Windows.
98101
(Antonin Décimo, review by David Allsopp and Xavier Leroy)
99102

otherlibs/dynlink/dynlink_common.ml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,6 @@ module Make (P : Dynlink_platform_intf.S) = struct
6262
were privately loaded. *)
6363
}
6464

65-
let invariant t =
66-
let ifaces = String.Map.keys t.ifaces in
67-
let implems = String.Map.keys t.implems in
68-
assert (String.Set.subset implems ifaces);
69-
assert (String.Set.subset t.main_program_units ifaces);
70-
assert (String.Set.subset t.main_program_units implems);
71-
assert (String.Set.subset t.public_dynamically_loaded_units ifaces);
72-
assert (String.Set.subset t.public_dynamically_loaded_units implems)
73-
7465
let empty = {
7566
ifaces = String.Map.empty;
7667
implems = String.Map.empty;
@@ -275,7 +266,6 @@ module Make (P : Dynlink_platform_intf.S) = struct
275266
public_dynamically_loaded_units;
276267
}
277268
in
278-
State.invariant state;
279269
state
280270
end
281271

testsuite/tests/lib-dynlink-initializers/test10_main.byte.reference

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ Called from Test10_plugin.f in file "test10_plugin.ml", line 6, characters 2-6
55
Called from Test10_plugin in file "test10_plugin.ml", line 10, characters 2-6
66
Called from Dynlink.Bytecode.run in file "otherlibs/dynlink/dynlink.ml", line 137, characters 16-25
77
Re-raised at Dynlink.Bytecode.run in file "otherlibs/dynlink/dynlink.ml", line 139, characters 6-137
8-
Called from Dynlink_common.Make.load.(fun) in file "otherlibs/dynlink/dynlink_common.ml", line 347, characters 13-44
8+
Called from Dynlink_common.Make.load.(fun) in file "otherlibs/dynlink/dynlink_common.ml", line 337, characters 13-44
99
Called from Stdlib__List.iter in file "list.ml", line 110, characters 12-15
10-
Called from Dynlink_common.Make.load in file "otherlibs/dynlink/dynlink_common.ml", line 345, characters 8-240
11-
Re-raised at Dynlink_common.Make.load in file "otherlibs/dynlink/dynlink_common.ml", line 355, characters 8-17
10+
Called from Dynlink_common.Make.load in file "otherlibs/dynlink/dynlink_common.ml", line 335, characters 8-240
11+
Re-raised at Dynlink_common.Make.load in file "otherlibs/dynlink/dynlink_common.ml", line 345, characters 8-17
1212
Called from Test10_main in file "test10_main.ml", line 51, characters 13-69

testsuite/tests/lib-dynlink-initializers/test10_main.native.reference

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ Called from Dynlink.Native.run.(fun) in file "otherlibs/dynlink/native/dynlink.m
66
Called from Dynlink.Native.run.(fun) in file "otherlibs/dynlink/native/dynlink.ml", line 85, characters 12-29
77
Re-raised at Dynlink.Native.run.(fun) in file "otherlibs/dynlink/native/dynlink.ml", line 87, characters 10-149
88
Called from Stdlib__List.iter in file "list.ml", line 110, characters 12-15
9-
Called from Dynlink_common.Make.load.(fun) in file "otherlibs/dynlink/dynlink_common.ml", line 347, characters 13-44
9+
Called from Dynlink_common.Make.load.(fun) in file "otherlibs/dynlink/dynlink_common.ml", line 337, characters 13-44
1010
Called from Stdlib__List.iter in file "list.ml", line 110, characters 12-15
11-
Called from Dynlink_common.Make.load in file "otherlibs/dynlink/dynlink_common.ml", line 345, characters 8-240
12-
Re-raised at Dynlink_common.Make.load in file "otherlibs/dynlink/dynlink_common.ml", line 355, characters 8-17
13-
Called from Dynlink_common.Make.loadfile in file "otherlibs/dynlink/dynlink_common.ml" (inlined), line 357, characters 26-45
11+
Called from Dynlink_common.Make.load in file "otherlibs/dynlink/dynlink_common.ml", line 335, characters 8-240
12+
Re-raised at Dynlink_common.Make.load in file "otherlibs/dynlink/dynlink_common.ml", line 345, characters 8-17
13+
Called from Dynlink_common.Make.loadfile in file "otherlibs/dynlink/dynlink_common.ml" (inlined), line 347, characters 26-45
1414
Called from Test10_main in file "test10_main.ml", line 49, characters 30-87

0 commit comments

Comments
 (0)