[buddy]
* buddy/src/kernel.c (bdd_addref, bdd_delref): Disable sanity checks when compiled with NDEBUG.
This commit is contained in:
parent
9f63bb6637
commit
197019ea62
2 changed files with 15 additions and 2 deletions
|
|
@ -1,3 +1,8 @@
|
||||||
|
2011-04-03 Alexandre Duret-Lutz <adl@lrde.epita.fr>
|
||||||
|
|
||||||
|
* buddy/src/kernel.c (bdd_addref, bdd_delref): Disable sanity
|
||||||
|
checks when compiled with NDEBUG.
|
||||||
|
|
||||||
2011-02-27 Alexandre Duret-Lutz <adl@lrde.epita.fr>
|
2011-02-27 Alexandre Duret-Lutz <adl@lrde.epita.fr>
|
||||||
|
|
||||||
* examples/cmilner/Makefile.am (cmilner_LDADD): Link with -lm, to
|
* examples/cmilner/Makefile.am (cmilner_LDADD): Link with -lm, to
|
||||||
|
|
|
||||||
|
|
@ -1114,13 +1114,17 @@ RETURN {* The BDD node {\tt r}. *}
|
||||||
*/
|
*/
|
||||||
BDD bdd_addref(BDD root)
|
BDD bdd_addref(BDD root)
|
||||||
{
|
{
|
||||||
|
#if NDEBUG
|
||||||
|
if (root < 2)
|
||||||
|
return root;
|
||||||
|
#else
|
||||||
if (root < 2 || !bddrunning)
|
if (root < 2 || !bddrunning)
|
||||||
return root;
|
return root;
|
||||||
if (root >= bddnodesize)
|
if (root >= bddnodesize)
|
||||||
return bdd_error(BDD_ILLBDD);
|
return bdd_error(BDD_ILLBDD);
|
||||||
if (LOW(root) == -1)
|
if (LOW(root) == -1)
|
||||||
return bdd_error(BDD_ILLBDD);
|
return bdd_error(BDD_ILLBDD);
|
||||||
|
#endif
|
||||||
INCREF(root);
|
INCREF(root);
|
||||||
return root;
|
return root;
|
||||||
}
|
}
|
||||||
|
|
@ -1140,6 +1144,10 @@ RETURN {* The BDD node {\tt r}. *}
|
||||||
*/
|
*/
|
||||||
BDD bdd_delref(BDD root)
|
BDD bdd_delref(BDD root)
|
||||||
{
|
{
|
||||||
|
#if NDEBUG
|
||||||
|
if (root < 2)
|
||||||
|
return root;
|
||||||
|
#else
|
||||||
if (root < 2 || !bddrunning)
|
if (root < 2 || !bddrunning)
|
||||||
return root;
|
return root;
|
||||||
if (root >= bddnodesize)
|
if (root >= bddnodesize)
|
||||||
|
|
@ -1149,7 +1157,7 @@ BDD bdd_delref(BDD root)
|
||||||
|
|
||||||
/* if the following line is present, fails there much earlier */
|
/* if the following line is present, fails there much earlier */
|
||||||
if (!HASREF(root)) bdd_error(BDD_BREAK); /* distinctive */
|
if (!HASREF(root)) bdd_error(BDD_BREAK); /* distinctive */
|
||||||
|
#endif
|
||||||
DECREF(root);
|
DECREF(root);
|
||||||
return root;
|
return root;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue