scm_new_smob, scm_new_double_smob inline functions
authorAndy Wingo <wingo@pobox.com>
Thu, 26 May 2011 14:49:47 +0000 (16:49 +0200)
committerAndy Wingo <wingo@pobox.com>
Thu, 26 May 2011 15:17:53 +0000 (17:17 +0200)
commit27583e746617ebb7351a05952c52331b81ddd70d
treec16e4b375c8940abf733b1fd1d2b95868ee7d139
parentff670362aae35495cf0861ba3435bbabbaaa3a7b
scm_new_smob, scm_new_double_smob inline functions

* libguile/smob.h (scm_new_smob, scm_new_double_smob): New constructors,
  which do what SCM_NEWSMOB / SCM_NEWSMOB3 had done, but with inline
  functions instead of macros.  They also bail to scm_i_new_smob /
  scm_i_new_double_smob in either the mark or the free case, so that the
  inline definition doesn't reference other internal details like libgc
  stuff.
  (SCM_SMOB_TYPE_MASK et al): Move definitions up so the new_smob see
  them as already being declared.
  (SCM_NEWSMOB, SCM_RETURN_NEWSMOB, SCM_NEWSMOB2, SCM_RETURN_NEWSMOB2):
  (SCM_NEWSMOB3, SCM_RETURN_NEWSMOB3): Reimplement in terms of the new
  inline functions.
  (scm_i_finalize_smob): Remove declaration, as it's no longer needed or
  used.
  Remove now-unneeded bdw-gc include.

* libguile/smob.c (finalize_smob): Rename from scm_i_finalize_smob, and
  make static.
  (scm_i_new_smob, scm_i_new_double_smob): Slow-path allocators.

* libguile/inline.c: Include smob.h, so as to reify scm_new_smob and
  scm_new_double_smob.
libguile/inline.c
libguile/smob.c
libguile/smob.h