Add --no-debug-leak to reduce memory use under debug.

This commit is contained in:
John Coiner
2018-03-10 12:18:19 -05:00
committed by Wilson Snyder
parent 9ae54786e4
commit ff82f75023
7 changed files with 60 additions and 1 deletions
+9 -1
View File
@@ -677,9 +677,17 @@ void AstNode::deleteNode() {
this->m_op2p = (AstNode*)1;
this->m_op3p = (AstNode*)1;
this->m_op4p = (AstNode*)1;
if (
#if !defined(VL_DEBUG) || defined(VL_LEAK_CHECKS)
delete this; // Leak massively, so each pointer is unique and we can debug easier
1
#else
!v3Global.opt.debugLeak()
#endif
) {
delete this;
}
// Else leak massively, so each pointer is unique
// and we can debug easier.
}
AstNode::~AstNode() {