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:21:49 +0000 (20:21 +0100)
commitc05805a4ea764dec5a0559edefcdfb9761191d07
tree3925d77d81c82be61e407abf36f17634ee18b462
parent89d45e850725e232ae685803ee476da5b046c2b0
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