[comp.graphics] The Reason DKBTrace Hangs Under Turbo C++

npw@eleazar.dartmouth.edu (Nicholas Wilt) (05/01/91)

The reason DKB is hanging during malloc() is because Symbol_Table
is being freed more than once.  Since attempts to free non-allocated 
memory go unnoticed (without side effects) by most compilers, that is 
why the problem is isolated to Turbo C++.

Try deleting the call free(Symbol_Table) in Terminate_Tokenizer.
I am not positive that fixes the problem, but I am sure that the 
multiple free()s are causing it.

--Nick
  npw@eleazar.dartmouth.edu

craig@hpctdkz.HP.COM (/craig lindley) (05/06/91)

/ hpctdkz:comp.graphics / npw@eleazar.dartmouth.edu (Nicholas Wilt) / 10:26 pm  Apr 30, 1991 /
The reason DKB is hanging during malloc() is because Symbol_Table
is being freed more than once.  Since attempts to free non-allocated 
memory go unnoticed (without side effects) by most compilers, that is 
why the problem is isolated to Turbo C++.

Try deleting the call free(Symbol_Table) in Terminate_Tokenizer.
I am not positive that fixes the problem, but I am sure that the 
multiple free()s are causing it.

--Nick
  npw@eleazar.dartmouth.edu


Nick,
 You were right on the money. I wrote a new free function which
checked for NULL pointers before it freed the memory and then set
the pointer to NULL thus preventing it from being freed again and
you guessed it, DKBTrace now compiles and runs under Borland C++.
Thank you very much for the clue.

Craig A. Lindley

----------