Skip to content

Commit

Permalink
Remove expensive debug assertion from dynlink (ocaml#10184)
Browse files Browse the repository at this point in the history
  • Loading branch information
lpw25 authored and smuenzel committed Mar 30, 2021
1 parent 6d588d0 commit 9ec3a4e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 17 deletions.
3 changes: 3 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ Working version
directory.
(Nicolás Ojeda Bär, review by Gabriel Scherer and Xavier Leroy)

- #10184: Remove expensive debug assertion from dynlink.
(Leo White, review by David Allsopp and Xavier Leroy)

- #10185: Consider that IPv6 is always enabled on Windows.
(Antonin Décimo, review by David Allsopp and Xavier Leroy)

Expand Down
10 changes: 0 additions & 10 deletions otherlibs/dynlink/dynlink_common.ml
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,6 @@ module Make (P : Dynlink_platform_intf.S) = struct
were privately loaded. *)
}

let invariant t =
let ifaces = String.Map.keys t.ifaces in
let implems = String.Map.keys t.implems in
assert (String.Set.subset implems ifaces);
assert (String.Set.subset t.main_program_units ifaces);
assert (String.Set.subset t.main_program_units implems);
assert (String.Set.subset t.public_dynamically_loaded_units ifaces);
assert (String.Set.subset t.public_dynamically_loaded_units implems)

let empty = {
ifaces = String.Map.empty;
implems = String.Map.empty;
Expand Down Expand Up @@ -275,7 +266,6 @@ module Make (P : Dynlink_platform_intf.S) = struct
public_dynamically_loaded_units;
}
in
State.invariant state;
state
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ Called from Test10_plugin.f in file "test10_plugin.ml", line 6, characters 2-6
Called from Test10_plugin in file "test10_plugin.ml", line 10, characters 2-6
Called from Dynlink.Bytecode.run in file "otherlibs/dynlink/dynlink.ml", line 137, characters 16-25
Re-raised at Dynlink.Bytecode.run in file "otherlibs/dynlink/dynlink.ml", line 139, characters 6-137
Called from Dynlink_common.Make.load.(fun) in file "otherlibs/dynlink/dynlink_common.ml", line 347, characters 13-44
Called from Dynlink_common.Make.load.(fun) in file "otherlibs/dynlink/dynlink_common.ml", line 337, characters 13-44
Called from Stdlib__List.iter in file "list.ml", line 110, characters 12-15
Called from Dynlink_common.Make.load in file "otherlibs/dynlink/dynlink_common.ml", line 345, characters 8-240
Re-raised at Dynlink_common.Make.load in file "otherlibs/dynlink/dynlink_common.ml", line 355, characters 8-17
Called from Dynlink_common.Make.load in file "otherlibs/dynlink/dynlink_common.ml", line 335, characters 8-240
Re-raised at Dynlink_common.Make.load in file "otherlibs/dynlink/dynlink_common.ml", line 345, characters 8-17
Called from Test10_main in file "test10_main.ml", line 51, characters 13-69
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ Called from Dynlink.Native.run.(fun) in file "otherlibs/dynlink/native/dynlink.m
Called from Dynlink.Native.run.(fun) in file "otherlibs/dynlink/native/dynlink.ml", line 85, characters 12-29
Re-raised at Dynlink.Native.run.(fun) in file "otherlibs/dynlink/native/dynlink.ml", line 87, characters 10-149
Called from Stdlib__List.iter in file "list.ml", line 110, characters 12-15
Called from Dynlink_common.Make.load.(fun) in file "otherlibs/dynlink/dynlink_common.ml", line 347, characters 13-44
Called from Dynlink_common.Make.load.(fun) in file "otherlibs/dynlink/dynlink_common.ml", line 337, characters 13-44
Called from Stdlib__List.iter in file "list.ml", line 110, characters 12-15
Called from Dynlink_common.Make.load in file "otherlibs/dynlink/dynlink_common.ml", line 345, characters 8-240
Re-raised at Dynlink_common.Make.load in file "otherlibs/dynlink/dynlink_common.ml", line 355, characters 8-17
Called from Dynlink_common.Make.loadfile in file "otherlibs/dynlink/dynlink_common.ml" (inlined), line 357, characters 26-45
Called from Dynlink_common.Make.load in file "otherlibs/dynlink/dynlink_common.ml", line 335, characters 8-240
Re-raised at Dynlink_common.Make.load in file "otherlibs/dynlink/dynlink_common.ml", line 345, characters 8-17
Called from Dynlink_common.Make.loadfile in file "otherlibs/dynlink/dynlink_common.ml" (inlined), line 347, characters 26-45
Called from Test10_main in file "test10_main.ml", line 49, characters 30-87

0 comments on commit 9ec3a4e

Please sign in to comment.