Mir

Code review comment for lp:~afrantzis/mir/client-api-platform-operation-spike

Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

> 1. Since we are no longer bound to MirPlatformPackage, we could change our data array to hold bytes
> instead of ints. I am in favor of the byte array, since it makes it easier to pass arbitrary data.

Done.

> 2. If the team doesn't like the reference counting scheme we could also use a create/copy/release scheme

I decided to abandon these schemes completely and I also stopped trying to make the message object smarter/safer than it can reasonably be in C. It is meant to be just an opaque struct of arrays. The new state of things is:

1. MirPlatformMessage is owned by the callee in the context of the callback. The callee is responsible for forwarding it, releasing it etc.

2. MirPlatformMessage is just a container of information. It owns the memory needed to hold the information but not the information itself. That means that when in upcoming MPs it will contain fds, the fds will not be closed when the message is released, much like an array of int fds doesn't release them. The user will need to get and manipulate/close the fds manually.

« Back to merge proposal