lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

> I'm not seeing why the scoped local (?) needs to be "allocated". Are you
> actually meaning a malloc? I would have thought in the implementation that
> the local would be annotated somehow similar to closure upvalues that are
> pulled off the function stack during return or error. Except the scoped
> local never needs to be pulled off the stack because when the scope ends
> for any reason, the value it stores is __exit()ed. (It is probably
> nonsensical for a local to be scoped and an upvalues.)

Closure upvales are allocated (malloc'ed) in the current implementation.

You are right that we could put some kind of annotation directly in the
stack, but that is not how the simple implementation being considered
until now works. (Moreover, I think any annotation in the stack would
add more problems than it solves.)

-- Roberto