core: gc: Enable memory dump debugging.

* src/gc.c (gc): If MES_DUMP is set, dump arena.  [POINTER_CELLS &&
!GC_NOFLIP]: Run gc_ twice to enable comparing memory dumps.
This commit is contained in:
Jan (janneke) Nieuwenhuizen 2019-11-03 08:35:56 +01:00
parent 477eee6e02
commit 70c12c70b3
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
1 changed files with 7 additions and 0 deletions

View File

@ -745,6 +745,8 @@ gc_ ()
SCM
gc ()
{
if (getenv ("MES_DUMP") != 0)
gc_dump_arena (g_cells, gc_free ());
if (g_debug > 5)
{
eputs ("symbols: ");
@ -756,6 +758,9 @@ gc ()
}
gc_push_frame ();
gc_ ();
#if POINTER_CELLS && !GC_NOFLIP
gc_ ();
#endif
gc_pop_frame ();
if (g_debug > 5)
{
@ -766,6 +771,8 @@ gc ()
write_error_ (R0);
eputs ("\n");
}
if (getenv ("MES_DUMP") != 0)
gc_dump_arena (g_cells, gc_free ());
return cell_unspecified;
}