diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2018-06-21 06:29:32 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2018-06-21 06:29:32 -0700 |
commit | 1439785d5659936d0c22273a85a7c6594429649f (patch) | |
tree | 745ea327d90de07412432d16864c813cec3c8488 /unwind.h | |
parent | 793a8bd3995c0ecc272e7dce16c9d7c6ec85e9bb (diff) | |
download | txr-1439785d5659936d0c22273a85a7c6594429649f.tar.gz txr-1439785d5659936d0c22273a85a7c6594429649f.tar.bz2 txr-1439785d5659936d0c22273a85a7c6594429649f.zip |
vm: release cached bindings that become unbound.
When a function binding is removed using fmakunbound, virtual
machine descriptions hang on to the previously cached binding
in the ftab. When the symbol is newly bound, virtual machine
descriptions keep pointing to the old function.
To solve this, we put the vm_desc structures into a global
list and provide a function that fmakunbound calls to scrub
all the VM descriptors of that binding.
* eval.c (makunbound, fmakunbound): Call new
vm_invalidate_binding function.
* vm.c (struct vm_desc_links): New structure.
(struct vm_desc): New member lnk, with links.
(vmd_list): New static variable: circular list of all VM
descriptors.
(vm_make_desc): Insert new VM descriptor into list.
(vm_desc_destroy): Remove VM descriptor from list.
(vm_invalidate_binding): New function.
* vm.h (vm_invalidate_binding): Declared.
Diffstat (limited to 'unwind.h')
0 files changed, 0 insertions, 0 deletions