Mir

Code review comment for lp:~vanvugt/mir/fix-1628794

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

All good questions but those are issues I have already considered...

* Why do a memory allocation? Because each call completes asynchronously in the background and must point to a valid Void object and not NULL, or it will crash.

* Stack variables: Not an option. The call completes in the background so the result lives longer than the stack memory that initiated it.

* google::protobuf::DoNothing: Also not an option. The Void* must point to a valid Void object which exists long enough for protobuf to populate it and make the callback. The callback must reference the Void object and be the last reference to it so it gets freed.

* Void is not really void. It contains useful error messages and codes, which we should pay more attention to.

« Back to merge proposal