From d6ad3bb328867c4597e0ea400a8a05850a992203 Mon Sep 17 00:00:00 2001 From: trevor_hansen Date: Sun, 4 Jul 2010 12:23:07 +0000 Subject: [PATCH] Free the memory allocatated to the AIGs before SAT solving. git-svn-id: https://stp-fast-prover.svn.sourceforge.net/svnroot/stp-fast-prover/trunk/stp@919 e59a4935-1847-0410-ae03-e826735625c1 --- scripts/Makefile.common | 3 ++- src/to-sat/AIG/BBNodeManagerAIG.h | 9 ++++++++- src/to-sat/AIG/ToSATAIG.h | 4 ++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/scripts/Makefile.common b/scripts/Makefile.common index 08a6ca4..765b520 100644 --- a/scripts/Makefile.common +++ b/scripts/Makefile.common @@ -16,7 +16,8 @@ #OPTIMIZE = -O3 -march=native -fomit-frame-pointer # Maximum optimization #OPTIMIZE = -O3 -march=native -DNDEBUG -DLESSBYTES_PERNODE OPTIMIZE = -O3 # Maximum optimization -CFLAGS_M32 = -m32 -g +CFLAGS_M32 = -g + #-fno-inline CFLAGS_BASE = $(OPTIMIZE) diff --git a/src/to-sat/AIG/BBNodeManagerAIG.h b/src/to-sat/AIG/BBNodeManagerAIG.h index 94f6f6d..25c323a 100644 --- a/src/to-sat/AIG/BBNodeManagerAIG.h +++ b/src/to-sat/AIG/BBNodeManagerAIG.h @@ -85,9 +85,16 @@ public: aigMgr->fAddStrash = 1; } + void stop() + { + if (aigMgr !=NULL) + Aig_ManStop(aigMgr); + aigMgr = NULL; + } + ~BBNodeManagerAIG() { - Aig_ManStop(aigMgr); + stop(); } BBNodeAIG getTrue() diff --git a/src/to-sat/AIG/ToSATAIG.h b/src/to-sat/AIG/ToSATAIG.h index 73a57e9..d09176f 100644 --- a/src/to-sat/AIG/ToSATAIG.h +++ b/src/to-sat/AIG/ToSATAIG.h @@ -70,6 +70,10 @@ namespace BEEV mgr.toCNF(BBFormula, cnfData, nodeToSATVar); + // Free the memory in the AIGs. + BBFormula = BBNodeAIG(); // null node + mgr.stop(); + bm->GetRunTimes()->start(RunTimes::SendingToSAT); for (int i = 0; i < cnfData->nVars; i++) -- 2.47.3