slash-lang / slash

A new language for the web
http://slash-lang.org
MIT License
386 stars 22 forks source link

Make the VM store an array #23

Closed haileys closed 10 years ago

haileys commented 10 years ago

The VM store (where extensions can shove arbitrary data that they need to access globally within a VM) is currently a hash table keyed on addresses of static variables (this ensures uniqueness of keys).

This pull request replaces the current hashtable based VM store with an array. Extensions can register VM store slots when Slash statically initializes with sl_vm_store_register_slot(). This function returns an index into the VM store array that extensions can use to access the VM store when running in a VM.