make applicable smob calls cheaper, and fix a memory leak
authorAndy Wingo <wingo@pobox.com>
Sun, 18 Mar 2012 19:04:28 +0000 (20:04 +0100)
committerAndy Wingo <wingo@pobox.com>
Sun, 18 Mar 2012 19:06:06 +0000 (20:06 +0100)
commit80be163f81e0dcc16e6805d4c2d1f2de3ca38c55
tree4826f61678e7792d73bc957a7f3af29aacae67a2
parentd5e1f8224068c3c579b9a6d77450d50af512aa52
make applicable smob calls cheaper, and fix a memory leak

* libguile/vm.c (prepare_smob_call): New helper.  Now, instead of making
  a per-smob trampoline, we will shuffle the smob into the args and use
  a gsubr.  This prevents a memory leak in which the trampolines, which
  were values in a weak-key table, were preventing the smobs from being
  collected.

* libguile/vm-i-system.c (call, tail-call, mv-call): Adapt to new smob
  application mechanism.
  (smob-call): Remove this instruction.

* libguile/smob.h (scm_smob_descriptor): Rename apply_trampoline_objcode
  to apply_trampoline.

* libguile/smob.c: Remove our own objcode trampolines in favor of using
  scm_c_make_gsubr.
  (scm_smob_prehistory): No more trampoline weak map.

* libguile/procprop.c (scm_i_procedure_arity): Adapt to applicable smob
  representation change.
libguile/procprop.c
libguile/smob.c
libguile/smob.h
libguile/vm-i-system.c
libguile/vm.c