Careful debugging of the memory leak problem. At this stage,
stack frames for interpreted (but not primitive) functions appear not to be being reclaimed, and the oblist doesn't seem to be being fully reclaimed.
This commit is contained in:
parent
8629e33f92
commit
70376c6529
14 changed files with 156 additions and 50 deletions
15
src/init.c
15
src/init.c
|
|
@ -185,6 +185,7 @@ void print_options( FILE *stream ) {
|
|||
L"\t-d\tDump memory to standard out at end of run (copious!);\n" );
|
||||
fwprintf( stream, L"\t-h\tPrint this message and exit;\n" );
|
||||
fwprintf( stream, L"\t-p\tShow a prompt (default is no prompt);\n" );
|
||||
#ifdef DEBUG
|
||||
fwprintf( stream,
|
||||
L"\t-v LEVEL\n\t\tSet verbosity to the specified level (0...512)\n" );
|
||||
fwprintf( stream, L"\t\tWhere bits are interpreted as follows:\n" );
|
||||
|
|
@ -197,6 +198,7 @@ void print_options( FILE *stream ) {
|
|||
fwprintf( stream, L"\t\t64\tLAMBDA;\n" );
|
||||
fwprintf( stream, L"\t\t128\tREPL;\n" );
|
||||
fwprintf( stream, L"\t\t256\tSTACK.\n" );
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -384,14 +386,19 @@ int main( int argc, char *argv[] ) {
|
|||
repl( show_prompt );
|
||||
|
||||
debug_dump_object( oblist, DEBUG_BOOTSTRAP );
|
||||
|
||||
debug_print( L"Freeing oblist\n", DEBUG_BOOTSTRAP );
|
||||
while ( (pointer2cell(oblist)).count > 0) {
|
||||
fprintf( stderr, "Dangling refs on oblist: %d\n", (pointer2cell(oblist)).count );
|
||||
dec_ref( oblist );
|
||||
}
|
||||
|
||||
free_init_symbols( );
|
||||
|
||||
if ( dump_at_end ) {
|
||||
dump_pages( file_to_url_file( stdout ) );
|
||||
}
|
||||
|
||||
debug_print( L"Freeing oblist\n", DEBUG_BOOTSTRAP );
|
||||
dec_ref( oblist );
|
||||
free_init_symbols( );
|
||||
|
||||
summarise_allocation( );
|
||||
curl_global_cleanup( );
|
||||
return ( 0 );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue