2 grob-smob.cc -- implement GROB smob routines.
4 source file of the GNU LilyPond music typesetter
6 (c) 2005--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
11 #include "paper-score.hh"
13 #include "ly-smobs.icc"
15 IMPLEMENT_SMOBS (Grob);
16 IMPLEMENT_DEFAULT_EQUAL_P (Grob);
17 IMPLEMENT_TYPE_P (Grob, "ly:grob?");
20 Grob::mark_smob (SCM ses)
22 Grob *s = (Grob *) SCM_CELL_WORD_1 (ses);
23 scm_gc_mark (s->immutable_property_alist_);
25 /* Do not mark the parents. The pointers in the mutable
26 property list form two tree like structures (one for X
27 relations, one for Y relations). Marking these can be done
28 in limited stack space. If we add the parents, we will jump
29 between X and Y in an erratic manner, leading to much more
30 recursion depth (and core dumps if we link to pthreads). */
33 scm_gc_mark (s->original ()->self_scm ());
36 scm_gc_mark (s->object_alist_);
37 scm_gc_mark (s->interfaces_);
39 return s->mutable_property_alist_;
43 Grob::print_smob (SCM s, SCM port, scm_print_state *)
45 Grob *sc = (Grob *) SCM_CELL_WORD_1 (s);
47 scm_puts ("#<Grob ", port);
48 scm_puts ((char *) sc->name ().c_str (), port);
50 /* Do not print properties, that is too much hassle. */
51 scm_puts (" >", port);
56 Grob::derived_mark () const