[Not to land] Rebase D148288 and associated tests on D148191
Apologies for the sequence of commits mashed together, I don't know how to untangle
them in phab from the github fork Joseph pointed me to. This isn't a patch to land,
creating for discussion. It's also somewhat messy - the interface from D148288,
namely alternating send/recv model - and the state in the Port instance are unchanged
and don't mesh particularly cleanly with the previous patch.
Handle server leaks ports in D148288, could have been a compile time error
Odd number of send/recv calls in D148288 will leave ports that can never be opened again
The ack/data distinction is not necessary to encode the desired send/recv model
Tests pass as before. The simplified bitmap hacked together for D148585 doesn't work so
this patch uses the real one.
Primary change is to drop the ack/data distinction in favour of inbox==outbox implies
ownship and inbox != outbox implies the other process owns the buffer. This seems to be
the primary difference in modelling the domain between the two patches.
codegen around this branch is probably a mess, written like this for clarity of exposition not for performance. In particular clang probably inlines the functor twice and will need hand holding to avoid that. Or raise outbox to a compile time parameter as I prefer and it'll fold correctly