[Vm-dev] VM handle management

Bert Freudenberg bert at freudenbergs.de
Wed Mar 24 14:24:01 UTC 2010


On 24.03.2010, at 04:10, Andreas Raab wrote:
> 
> 
> Here's my proposal. I say let's extend the VM with 4 new proxy functions, namely:
> 
>  /* Registers a pointer and returns a handle.
>     The type argument ensures that the handle cannot be forged. */
>  OOP registerHandleType(void *ptr, char *type);
> 
>  /* Unregister a handle */
>  void unregisterHandle(void *ptr);
> 
>  /* Look up the pointer for a given handle/pair type */
>  void* lookupHandleType(OOP handle, char *type);
> 
>  /* Ditto, just based on a stack index */
>  void* stackHandleValueType(int stackIndex, char *type);

Love it. Should have proposed something like this the third time *I* implemented another ad-hoc handle scheme ;)

- Bert -



More information about the Vm-dev mailing list