* minor SCM_DEBUG patch
@ 2009-10-29 17:51 Ken Raeburn
2009-10-30 21:23 ` Neil Jerram
2009-10-31 23:11 ` Ludovic Courtès
0 siblings, 2 replies; 4+ messages in thread
From: Ken Raeburn @ 2009-10-29 17:51 UTC (permalink / raw)
To: guile-devel
The SCM_GC_MARK_P macro doesn't exist any more, but is still mentioned
in a few places. With SCM_DEBUG defined, one of them actually gets
compiled. While looking at this, I also noticed three macros in
deprecated.h (which were there in 1.8) which use non-existent macros
including SCM_GC_MARK_P, and deleted those too. I didn't touch the
other uses of SCM_GC_MARK_P in futures.c.
With this, and my pair-checking patches for objects.c and eval.i.c
(sent September 5, still awaiting review from a developer familiar
enough with the code), I can build a version with SCM_DEBUG that
passes tests.
Related but not addressed here: Several places still check
scm_gc_running_p and conditionally execute code (or not), but it's now
defined as a macro always expanding to 0.
Clean up some uses of old GC macros that don't exist any more.
* libguile/deprecated.h (SCM_GC8MARKP, SCM_SETGC8MARK,
SCM_CLRGC8MARK):
Delete.
* libguile/gc.c (scm_assert_cell_valid): Remove check of
SCM_GC_MARK_P.
diff --git a/libguile/deprecated.h b/libguile/deprecated.h
index ed1a105..5680d09 100644
--- a/libguile/deprecated.h
+++ b/libguile/deprecated.h
@@ -120,9 +120,6 @@ SCM_DEPRECATED SCM scm_unprotect_object (SCM obj);
(SCM_SETCDR ((x), SCM_PACK (SCM_UNPACK (SCM_CDR (x)) | (y))))
#define SCM_FREEP(x) (0)
#define SCM_NFREEP(x) (1)
-#define SCM_GC8MARKP(x) SCM_GC_MARK_P (x)
-#define SCM_SETGC8MARK(x) SCM_SET_GC_MARK (x)
-#define SCM_CLRGC8MARK(x) SCM_CLEAR_GC_MARK (x)
#define SCM_GCTYP16(x) SCM_TYP16 (x)
#define SCM_GCCDR(x) SCM_CDR (x)
SCM_DEPRECATED void scm_remember (SCM * ptr);
diff --git a/libguile/gc.c b/libguile/gc.c
index 9c56d04..96e3c30 100644
--- a/libguile/gc.c
+++ b/libguile/gc.c
@@ -146,18 +146,7 @@ scm_assert_cell_valid (SCM cell)
*/
if (scm_expensive_debug_cell_accesses_p)
scm_i_expensive_validation_check (cell);
-#if (SCM_DEBUG_MARKING_API == 0)
- if (!SCM_GC_MARK_P (cell))
- {
- fprintf (stderr,
- "scm_assert_cell_valid: this object is unmarked. \n"
- "It has been garbage-collected in the last GC run: "
- "%lux\n",
- (unsigned long) SCM_UNPACK (cell));
- abort ();
- }
-#endif /* SCM_DEBUG_MARKING_API */
-
+
scm_i_cell_validation_already_running = 0; /* re-enable */
}
}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: minor SCM_DEBUG patch
2009-10-29 17:51 minor SCM_DEBUG patch Ken Raeburn
@ 2009-10-30 21:23 ` Neil Jerram
2009-10-31 23:11 ` Ludovic Courtès
1 sibling, 0 replies; 4+ messages in thread
From: Neil Jerram @ 2009-10-30 21:23 UTC (permalink / raw)
To: Ken Raeburn; +Cc: guile-devel
Ken Raeburn <raeburn@raeburn.org> writes:
> The SCM_GC_MARK_P macro doesn't exist any more, but is still mentioned
> in a few places. With SCM_DEBUG defined, one of them actually gets
> compiled. While looking at this, I also noticed three macros in
> deprecated.h (which were there in 1.8) which use non-existent macros
> including SCM_GC_MARK_P, and deleted those too. I didn't touch the
> other uses of SCM_GC_MARK_P in futures.c.
This patch looks good to me too.
> Related but not addressed here: Several places still check
> scm_gc_running_p and conditionally execute code (or not), but it's now
> defined as a macro always expanding to 0.
After reviewing them, I'm pretty sure it would be OK to remove all of
those too. They're mostly to do with not being able to generate a
libguile exception during GC, and I believe that that possibility just
doesn't exist now. (Because the within-GC code is nothing to do with
libguile.)
Regards,
Neil
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: minor SCM_DEBUG patch
2009-10-29 17:51 minor SCM_DEBUG patch Ken Raeburn
2009-10-30 21:23 ` Neil Jerram
@ 2009-10-31 23:11 ` Ludovic Courtès
2009-11-03 1:47 ` Ken Raeburn
1 sibling, 1 reply; 4+ messages in thread
From: Ludovic Courtès @ 2009-10-31 23:11 UTC (permalink / raw)
To: guile-devel
Hello,
Ken Raeburn <raeburn@raeburn.org> writes:
> The SCM_GC_MARK_P macro doesn't exist any more, but is still mentioned
> in a few places. With SCM_DEBUG defined, one of them actually gets
> compiled. While looking at this, I also noticed three macros in
> deprecated.h (which were there in 1.8) which use non-existent macros
> including SCM_GC_MARK_P, and deleted those too. I didn't touch the
> other uses of SCM_GC_MARK_P in futures.c.
Looks good to me. In addition we could add this to ‘deprecated.h’:
#define SCM_GC_MARK_P scm_gc_mark_p
SCM_DEPRECATED int scm_gc_mark_p (SCM obj);
and:
int
scm_gc_mark_p (SCM obj)
{
/* `GC_is_visible ()' aborts if the given pointer is
not visible to the GC. */
GC_is_visible (SCM2PTR (obj));
return 1;
}
What do you think?
> Related but not addressed here: Several places still check
> scm_gc_running_p and conditionally execute code (or not), but it's now
> defined as a macro always expanding to 0.
Likewise, we could leave it as a deprecated thing (always 0) and also
remove its internal uses.
Thanks,
Ludo’.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: minor SCM_DEBUG patch
2009-10-31 23:11 ` Ludovic Courtès
@ 2009-11-03 1:47 ` Ken Raeburn
0 siblings, 0 replies; 4+ messages in thread
From: Ken Raeburn @ 2009-11-03 1:47 UTC (permalink / raw)
To: Ludovic Courtès; +Cc: guile-devel
On Oct 31, 2009, at 19:11, Ludovic Courtès wrote:
> Looks good to me. In addition we could add this to
> ‘deprecated.h’: ...SCM_GC_MARK_P...
SCM_GC_MARK_P wasn't deprecated in 1.8.0, so, yeah, if someone might
actually be using it (optimization within a smob mark function?), it
should probably be supplied and marked deprecated.
>> ...scm_gc_running_p...
>
> Likewise, we could leave it as a deprecated thing (always 0) and also
> remove its internal uses.
Yep.
Ken
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-11-03 1:47 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-29 17:51 minor SCM_DEBUG patch Ken Raeburn
2009-10-30 21:23 ` Neil Jerram
2009-10-31 23:11 ` Ludovic Courtès
2009-11-03 1:47 ` Ken Raeburn
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).