1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-17 17:20:29 +02:00

* gc-card.c ("sweep_card"): remove SCM_MISC_ERROR messages: print

message and abort.

* gc-mark.c ("scm_gc_mark_dependencies"): idem.
This commit is contained in:
Han-Wen Nienhuys 2002-08-08 23:18:23 +00:00
parent da220f2794
commit be3ff02158
4 changed files with 35 additions and 8 deletions

View file

@ -1,5 +1,10 @@
2002-08-09 Han-Wen Nienhuys <hanwen@cs.uu.nl> 2002-08-09 Han-Wen Nienhuys <hanwen@cs.uu.nl>
* gc-card.c ("sweep_card"): remove SCM_MISC_ERROR messages: print
message and abort.
* gc-mark.c ("scm_gc_mark_dependencies"): idem.
* ports.c ("scm_new_port_table_entry"): return a boxed SCM in * ports.c ("scm_new_port_table_entry"): return a boxed SCM in
stead of scm_t_port*. The function now takes a tag argument. stead of scm_t_port*. The function now takes a tag argument.

View file

@ -40,6 +40,8 @@
* If you do not wish that, delete this exception notice. */ * If you do not wish that, delete this exception notice. */
#include <stdio.h>
#include "libguile/_scm.h" #include "libguile/_scm.h"
#include "libguile/eval.h" #include "libguile/eval.h"
#include "libguile/stime.h" #include "libguile/stime.h"
@ -184,7 +186,10 @@ scm_i_sweep_card (scm_t_cell * p, SCM *free_list, int span)
size_t mm; size_t mm;
#if (SCM_DEBUG_CELL_ACCESSES == 1) #if (SCM_DEBUG_CELL_ACCESSES == 1)
if (!(k < scm_numptob)) if (!(k < scm_numptob))
SCM_MISC_ERROR ("undefined port type", SCM_EOL); {
fprintf (stderr, "undefined port type");
abort();
}
#endif #endif
/* Keep "revealed" ports alive. */ /* Keep "revealed" ports alive. */
if (scm_revealed_count (scmptr) > 0) if (scm_revealed_count (scmptr) > 0)
@ -239,7 +244,10 @@ scm_i_sweep_card (scm_t_cell * p, SCM *free_list, int span)
k = SCM_SMOBNUM (scmptr); k = SCM_SMOBNUM (scmptr);
#if (SCM_DEBUG_CELL_ACCESSES == 1) #if (SCM_DEBUG_CELL_ACCESSES == 1)
if (!(k < scm_numsmob)) if (!(k < scm_numsmob))
SCM_MISC_ERROR ("undefined smob type", SCM_EOL); {
fprintf (stderr, "undefined smob type");
abort();
}
#endif #endif
if (scm_smobs[k].free) if (scm_smobs[k].free)
{ {
@ -265,7 +273,8 @@ scm_i_sweep_card (scm_t_cell * p, SCM *free_list, int span)
} }
break; break;
default: default:
SCM_MISC_ERROR ("unknown type", SCM_EOL); fprintf (stderr, "unknown type");
abort();
} }

View file

@ -380,7 +380,10 @@ scm_must_free (void *obj)
if (obj) if (obj)
free (obj); free (obj);
else else
SCM_MISC_ERROR ("freeing NULL pointer", SCM_EOL); {
fprintf (stderr,"freeing NULL pointer");
abort ();
}
} }
#undef FUNC_NAME #undef FUNC_NAME

View file

@ -403,7 +403,10 @@ scm_gc_mark_dependencies (SCM p)
i = SCM_PTOBNUM (ptr); i = SCM_PTOBNUM (ptr);
#if (SCM_DEBUG_CELL_ACCESSES == 1) #if (SCM_DEBUG_CELL_ACCESSES == 1)
if (!(i < scm_numptob)) if (!(i < scm_numptob))
SCM_MISC_ERROR ("undefined port type", SCM_EOL); {
fprintf (stderr, "undefined port type");
abort();
}
#endif #endif
if (SCM_PTAB_ENTRY(ptr)) if (SCM_PTAB_ENTRY(ptr))
scm_gc_mark (SCM_FILENAME (ptr)); scm_gc_mark (SCM_FILENAME (ptr));
@ -431,7 +434,10 @@ scm_gc_mark_dependencies (SCM p)
i = SCM_SMOBNUM (ptr); i = SCM_SMOBNUM (ptr);
#if (SCM_DEBUG_CELL_ACCESSES == 1) #if (SCM_DEBUG_CELL_ACCESSES == 1)
if (!(i < scm_numsmob)) if (!(i < scm_numsmob))
SCM_MISC_ERROR ("undefined smob type", SCM_EOL); {
fprintf (stderr, "undefined smob type");
abort();
}
#endif #endif
if (scm_smobs[i].mark) if (scm_smobs[i].mark)
{ {
@ -443,7 +449,8 @@ scm_gc_mark_dependencies (SCM p)
} }
break; break;
default: default:
SCM_MISC_ERROR ("unknown type", SCM_EOL); fprintf (stderr, "unknown type");
abort();
} }
/* /*
@ -472,7 +479,10 @@ gc_mark_loop:
#endif #endif
if (!valid_cell) if (!valid_cell)
SCM_MISC_ERROR ("rogue pointer in heap", SCM_EOL); {
fprintf (stderr, "rogue pointer in heap");
abort();
}
} }
if (SCM_GC_MARK_P (ptr)) if (SCM_GC_MARK_P (ptr))