lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Likely a good frog project for someone with C knowledge


From: Reinhold Kainhofer
Subject: Re: Likely a good frog project for someone with C knowledge
Date: Tue, 16 Aug 2011 23:49:21 +0200
User-agent: KMail/1.13.6 (Linux/2.6.38-10-generic; KDE/4.7.0; i686; ; )

Am Tuesday, 16. August 2011, 23:36:15 schrieb Reinhold Kainhofer:
> However, I'm not sure if this will really work out or give us much benefit.
> In particular, we have lots of checks for == SCM_EOL or == SCM_BOOL_T. E.g.
> very deep inside the core of lilypond:
> 
> inline bool ly_cheap_is_list (SCM x) {return scm_is_pair (x) || x==SCM_EOL;
> }

Most of the errors will come from the implementation of ly_symbol2scm 
(lily/include/lily-guile-macros.hh):

#ifdef CACHE_SYMBOLS
[...]
/* Using this trick we cache the value of scm_from_locale_symbol ("fooo") 
where
   "fooo" is a constant string. This is done at the cost of one static
   variable per ly_symbol2scm() use, and one boolean evaluation for
   every call.
 */
#define ly_symbol2scm(x)                                                \
  ({                                                                    \
    static SCM cached;                                                  \
    /* We store this one locally, since G++ -O2 fucks up else */        \
    SCM value = cached;                                                 \
    if (__builtin_constant_p ((x)))                                     \
      {                                                                 \
        if (!cached)                                                    \
          value = cached = scm_gc_protect_object (scm_or_str2symbol (x)); \
      }                                                                 \
    else                                                                \
      value = scm_or_str2symbol (x);                                    \
    value;                                                              \
  })
#else


The "problem" is the !cached, which was added by Han-Wen in version 1.5.19 in 
commit 6c00542bf11cd4759b2e39537aeb3d9a533a3519 in October 2001 (before it was 
also there as a check "(cached)?cached:scm_..."). 

Cheers,
Reinhold
-- 
------------------------------------------------------------------
Reinhold Kainhofer, address@hidden, http://reinhold.kainhofer.com/
 * Financial & Actuarial Math., Vienna Univ. of Technology, Austria
 * http://www.fam.tuwien.ac.at/, DVR: 0005886
 * LilyPond, Music typesetting, http://www.lilypond.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]