Changes between Version 3 and Version 4 of NestedClosures


Ignore:
Timestamp:
Nov 29, 2017 7:41:31 PM (21 months ago)
Author:
alexbiehl
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • NestedClosures

    v3 v4  
    7878= Problem: Updatable thunks =
    7979
    80 While this solution is quite simple it poses some problems with respect to updatable thunks: If an `inner` closure refers to its `outer` closure, which happens to be an updatable thunk, we can't guarantee safe access to `outer`s free variables for `inner`! When `outer` is forced its value will be written back to `outer`s closure and `outer`s info table is updated to be an indirection instead of a thunk. `outer`s free variables are now considered garbage.
     80While this solution is quite simple it poses some problems with respect to updatable thunks: If an `inner` closure refers to its `outer` closure, which happens to be an updatable thunk, we can't guarantee safe access to `outer`s free variables for `inner`! When `outer` is forced its value will be written back to `outer`s closure and `outer`s info table is updated to be an indirection instead of a thunk. `outer`s free variables are now considered garbage and we might segfault when trying to access these in `inner`.
    8181
    8282== When exactly can we do this? ==