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, 8 Mar 2012 11:40:27 +0000 (12:40 +0100)
commitc46fee438cf9f4a3449e8d04e7a54805517fd092
treede3e26de211d64ab6a74e8ae9de03eac722c07c9
parent42d691ee16c7f6fd102d93f9e76d436f14198f2c
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.

  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.
  (scm_i_finalize_smob, scm_i_new_smob_with_mark_proc): Add
  back-compatibility shims to preserve ABI.

* 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