diff options
author | Han-Wen Nienhuys <hanwen@lilypond.org> | 2008-09-09 23:08:16 -0300 |
---|---|---|
committer | Han-Wen Nienhuys <hanwen@lilypond.org> | 2008-09-09 23:08:16 -0300 |
commit | 7ddb9baf80744f0ea4810c35b465d96f48338750 (patch) | |
tree | 7827a68cb9a524b33936703b113140e452b60c76 /libguile/gc-mark.c | |
parent | a8db4a59c898598cc55dd3bd86a6fd8618721d10 (diff) | |
download | guile-7ddb9baf80744f0ea4810c35b465d96f48338750.tar.gz |
Cleanup mark-during-GC debug checks.
* libguile/__scm.h (SCM_DEBUG): add SCM_DEBUG_MARKING_API
* libguile/gc.h (SCM_SET_GC_MARK): depending on
SCM_DEBUG_MARKING_API crash if someone is touching markbits
outside regular hours.
Rename ensure_marking() to scm_i_ensure_marking().
* libguile/inline.h (scm_double_cell, scm_cell): only set mark bits
for debugging if SCM_DEBUG_MARKING_API is unset
* libguile/gc-mark.c: Issue deprecation warning if we are marking
outside of the GC mark phase.
Diffstat (limited to 'libguile/gc-mark.c')
-rw-r--r-- | libguile/gc-mark.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libguile/gc-mark.c b/libguile/gc-mark.c index d72caf1ac..c334c1075 100644 --- a/libguile/gc-mark.c +++ b/libguile/gc-mark.c @@ -165,12 +165,19 @@ scm_gc_mark (SCM ptr) if (SCM_GC_MARK_P (ptr)) return; + if (!scm_i_marking) + { + static const char msg[] + = "Should only call scm_gc_mark() during GC."; + scm_c_issue_deprecation_warning (msg); + } + SCM_SET_GC_MARK (ptr); scm_gc_mark_dependencies (ptr); } void -ensure_marking (void) +scm_i_ensure_marking (void) { assert (scm_i_marking); } |