- /* \
- This is local. We don't assign to self_scm_ directly, to assure \
- that S isn't GC-ed from under us. \
- */ \
- SCM s = smobify (this); \
- self_scm_ = s; \
- scm_protect_object (s); \
- \
- scm_done_malloc(sizeof(CL));\
- do_smobify_self(); \
- return s; \
-} \
-scm_sizet \
-CL::free_smob (SCM ses) \
-{ \
- CL * s = (CL*) SCM_CDR(ses); \
- /* someone else did the deed already; this might be an automatic var.*/ \
- if (s->self_scm_ != ses)\
- return 0; \
-\
- /* no need to call scm_unprotect_object, since this call \
- implies that the object is not protected. */ \
- SCM_SETCAR (ses, SCM_EOL); \
- delete s;\
- return sizeof (CL);\
-} \
-ADD_SCM_INIT_FUNC(CL, CL::init_smobs)\
+ We don't use smobbed_self () to ensure that mark_smob () doesn't \
+ have to deal half-initialized objects: scm_done_malloc ( ) might \
+ trigger GC.the warning in smobs.hh is just to be doubleplus \
+ goodly sure \
+ */ \
+ SCM s; \
+ SCM_NEWSMOB (s, CL::smob_tag_, this); \
+ self_scm_ = s; \
+ scm_gc_register_collectable_memory (this, sizeof (CL), #CL " smob"); \
+ return s; \
+ }