* buddy/src/kernel.c (bdd_addref, bdd_delref): Disable sanity
checks when compiled with NDEBUG.
This commit is contained in:
Alexandre Duret-Lutz 2011-04-03 10:49:35 +02:00
parent 9f63bb6637
commit 197019ea62
2 changed files with 15 additions and 2 deletions

View file

@ -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>
* examples/cmilner/Makefile.am (cmilner_LDADD): Link with -lm, to

View file

@ -1114,13 +1114,17 @@ RETURN {* The BDD node {\tt r}. *}
*/
BDD bdd_addref(BDD root)
{
#if NDEBUG
if (root < 2)
return root;
#else
if (root < 2 || !bddrunning)
return root;
if (root >= bddnodesize)
return bdd_error(BDD_ILLBDD);
if (LOW(root) == -1)
return bdd_error(BDD_ILLBDD);
#endif
INCREF(root);
return root;
}
@ -1140,6 +1144,10 @@ RETURN {* The BDD node {\tt r}. *}
*/
BDD bdd_delref(BDD root)
{
#if NDEBUG
if (root < 2)
return root;
#else
if (root < 2 || !bddrunning)
return root;
if (root >= bddnodesize)
@ -1149,7 +1157,7 @@ BDD bdd_delref(BDD root)
/* if the following line is present, fails there much earlier */
if (!HASREF(root)) bdd_error(BDD_BREAK); /* distinctive */
#endif
DECREF(root);
return root;
}