Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Spot
Spot
Commits
17a7a782
Commit
17a7a782
authored
Oct 01, 2015
by
Alexandre Duret-Lutz
Browse files
* src/tl/formula.hh: Handle saturation of refs_.
parent
e5aebfd5
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/tl/formula.hh
View file @
17a7a782
...
...
@@ -53,6 +53,7 @@
#include
<list>
#include
<cstddef>
#include
<initializer_list>
#include
<limits>
namespace
spot
{
...
...
@@ -108,17 +109,20 @@ namespace spot
public:
const
fnode
*
clone
()
const
{
// Saturate.
++
refs_
;
if
(
SPOT_UNLIKELY
(
!
refs_
))
saturated_
=
1
;
return
this
;
}
void
destroy
()
const
{
// last reference to a node that is not a constant?
if
(
SPOT_UNLIKELY
(
!
refs_
&&
id_
>
2
))
destroy_aux
();
else
if
(
SPOT_LIKELY
(
refs_
))
--
refs_
;
else
if
(
SPOT_LIKELY
(
id_
>
2
)
&&
SPOT_LIKELY
(
!
saturated_
))
// last reference to a node that is not a constant
destroy_aux
();
}
static
constexpr
uint8_t
unbounded
()
...
...
@@ -443,7 +447,7 @@ namespace spot
op
op_
;
// operator
uint8_t
min_
;
// range minimum (for star-like operators)
uint8_t
max_
;
// range maximum;
//uint8_t unused_
;
mutable
uint8_t
saturated_
=
0
;
uint16_t
size_
;
// number of children
mutable
uint16_t
refs_
=
0
;
// reference count - 1;
size_t
id_
;
// Also used as hash.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment