mesos-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cody Maloney (JIRA)" <>
Subject [jira] [Commented] (MESOS-2238) Use Owned<> for Process pointers in wrapper classes
Date Wed, 21 Jan 2015 19:57:34 GMT


Cody Maloney commented on MESOS-2238:

Just want to add a little bit here from one of the google style guide maintainers about std::unique_ptr:

> Use Owned<> for Process pointers in wrapper classes
> ---------------------------------------------------
>                 Key: MESOS-2238
>                 URL:
>             Project: Mesos
>          Issue Type: Improvement
>            Reporter: Alexander Rukletsov
>              Labels: easyfix
> A common pattern in our code (see e.g. {{Isolator}}, {{DockerContainerizer}}, {{Allocator}})
is to wrap Process-based class into a non Process-one. However, our code base is inconsistent
about how we store the pointer to the underlying class: somewhere we wrap it into {{Owned<>}}
(see e.g. {{Isolator}}, {{DockerContainerizer}}), somewhere it is a raw pointer (see e.g.
{{Allocator}}, {{ExternalContainerizer}}).
> Using {{Owned<>}} for this particular case is preferable, since it hints the reader
about the correct semantics and intention. For consistency reason, sweep through the code
base and replace raw pointers with its {{Owned<>}} counterpart.

This message was sent by Atlassian JIRA

View raw message