Skip to content

Commit

Permalink
one more change to get examples working
Browse files Browse the repository at this point in the history
  • Loading branch information
David Hollman committed Apr 3, 2018
1 parent ce14764 commit e974df3
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/include/darma/impl/capture.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,10 @@ make_captured_use_holder(
// If a new use is made but it has access to the same data, pass the pointer
// on to the new use
if(capture_case.continuation_immediate != Permissions::None) {
assert(old_ptr);
source_and_continuing_holder->use()->data_ = old_ptr;
if(not source_and_continuing_holder->use()->manages_collection()) {
assert(old_ptr);
source_and_continuing_holder->use()->data_ = old_ptr;
}
}

// continuation can always be an alias if it's new
Expand Down
26 changes: 26 additions & 0 deletions src/include/darma/impl/capture/semantics.h
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,32 @@ _darma_CAPTURE_CASE_NO_NEW_CONTINUATION_USE(
false
);

// TODO Test this!!!
// %%%%%%%%%%%%%%%%%%%%%%%%%%%
// % MM -> { RN } -> MR %
// %%%%%%%%%%%%%%%%%%%%%%%%%%%
_darma_CAPTURE_CASE(
/* ---------- pattern parameters ---------- */
Sequential,
/* Source Permissions */
Modify, Modify,
/* captured permissions */
Read, None,
/* ---------- output for cases matching this pattern ----------*/
/* continuing permissions */
Modify, Read,
/* captured flows */
forwarding_flow(source_in), insignificant_flow(),
/* captured anti-flows */
insignificant_flow(), same_anti_flow(source_anti_out),
/* continuing flows */
same_flow(captured_in), same_flow(source_out),
/* continuing anti-flows */ /* Could be wrong about the anti-in flow?!?? */
insignificant_flow(), same_anti_flow(captured_anti_out),
/* could be alias: */
false
);

// %%%%%%%%%%%%%%%%%%%%%%%%%%%
// % MM -> { NR } -> MR %
// % MM -> { RR } -> MR %
Expand Down

0 comments on commit e974df3

Please sign in to comment.