[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: The life of a Grob
From: |
Joe Neeman |
Subject: |
Re: The life of a Grob |
Date: |
Sun, 17 Sep 2006 08:51:00 +1000 |
On Sat, 2006-09-16 at 16:29 +0200, Han-Wen Nienhuys wrote:
> Some comments:
>
> * can you add another macro layer, so __LINE__ and __FILE__ aren't
> sprinkled around in the code? For good measure, you could also add
> __FUNCTION__ .
How about something like the attached patch? I "overload" get_property
so that it can take a SCM directly. Then I can replace every
internal_get_property with get_property.
>
> * similarly, can you add macro layering, so that passing around line
> numbers/file names is entirely optional, and doesn't happen for a
> -DNDEBUG build?
Sure.
>
> * It might be possible to get some sort of causality in the diagram, by
> recursively tracing 'cause properties. Dunno if that helps understanding
> things, though.
Probably. There are a bunch more hooks I want to add too... this was
just the start :)
> > + protect ();
> > + if (ly_is_procedure (modification_callback))
> > + scm_apply_0 (modification_callback,
> > + scm_list_n (self_scm (), scm_makfrom0str (file),
> > scm_from_int (line),
> > + sym, v, SCM_UNDEFINED));
> > + unprotect ();
>
> this protection should not be necessary: as self_scm is passed as Stack
> variable it will be GC protected.
I was getting segfaults in scm_gc_mark and this magically solved it.
Being in dirty hack mode, I didn't investigate further. But you're
right.
tmp.patch
Description: Text Data
Re: The life of a Grob, Werner LEMBERG, 2006/09/16