File tree Expand file tree Collapse file tree 3 files changed +19
-7
lines changed Expand file tree Collapse file tree 3 files changed +19
-7
lines changed Original file line number Diff line number Diff line change 4
4
-- SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
5
5
--
6
6
7
+ with Ada.Unchecked_Deallocation ;
8
+
7
9
with AdaSAT.Vectors ;
8
10
with AdaSAT.Internals ; use AdaSAT.Internals;
9
11
Original file line number Diff line number Diff line change 5
5
--
6
6
7
7
with Ada.Strings.Unbounded ;
8
+ with Ada.Unchecked_Deallocation ;
8
9
9
10
package body AdaSAT is
11
+
12
+ procedure Free_Clause is new Ada.Unchecked_Deallocation
13
+ (Literal_Array, Clause);
14
+
10
15
-- -------
11
16
-- "+" --
12
17
-- -------
@@ -80,4 +85,13 @@ package body AdaSAT is
80
85
end loop ;
81
86
return To_String (Res);
82
87
end Image ;
88
+
89
+ -- --------
90
+ -- Free --
91
+ -- --------
92
+
93
+ procedure Free (C : in out Clause) is
94
+ begin
95
+ Free_Clause (C);
96
+ end Free ;
83
97
end AdaSAT ;
Original file line number Diff line number Diff line change 4
4
-- SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
5
5
--
6
6
7
- with Ada.Unchecked_Deallocation ;
8
-
9
7
-- The root package of the AdaSAT library. Defines the base data structures
10
8
-- that are used everywhere else.
11
9
-- You should instantiate the `AdaSAT.DPLL` package with your own theory or
@@ -61,6 +59,9 @@ package AdaSAT is
61
59
function Image (M : Model) return String;
62
60
-- Returns a string representation of the model
63
61
62
+ procedure Free (C : in out Clause);
63
+ -- Free memory allocated for the given clause
64
+
64
65
private
65
66
66
67
type Literal is new Integer;
@@ -72,9 +73,4 @@ private
72
73
--
73
74
-- Note that while both literals and variables are "just" integers, we
74
75
-- cannot mix them up in our code thanks to Ada's strong type system.
75
-
76
- procedure Free is new Ada.Unchecked_Deallocation
77
- (Literal_Array, Clause);
78
- -- We declare this here to make it available to each child package
79
- -- of AdaSAT.
80
76
end AdaSAT ;
You can’t perform that action at this time.
0 commit comments