[DGD] Switch to handles from object pointers

Felix A. Croes felix at dworkin.nl
Sat Jan 9 23:23:37 CET 2016


Carter Cheng <cartercheng at gmail.com> wrote:

> I am actually a bit confused by the implementation choice in lpc drivers in
> general over the use of object pointers over handles in the implementation
> given that one can explicitly destruct objects. It would seem to me that
> handles would be better in that one could update the handle pointer to
> point to null effectively destructing the object without having to traverse
> other data structures like the stack.
>
> This would also make it possible to implement a in memory stackless jit
> more easily since one does not need to using the single static assigment
> form track various variables explicitly in another data structure in the
> oft-chance an object is destructed.

Um, did you mean to post that to a different mailing list?  DGD does use
handles rather than object pointers.

Traversing the stack to wipe out handles of destructed objects is an
optimization, in that it allows other code to assume that handles on the
stack are always valid and don't have to be checked.  If you don't want
to do that for JIT-compiled code, fine -- you'll need more validity
checks for handles everywhere.

Regards,
Felix Croes



More information about the DGD mailing list