DevinLeamy commented on code in PR #557:
URL: https://github.com/apache/mesos/pull/557#discussion_r1566279961


##########
src/linux/cgroups2.hpp:
##########
@@ -217,9 +217,49 @@ Try<BandwidthLimit> max(const std::string& cgroup);
 
 namespace memory {
 
+// Memory usage limit.
+//
+// Represents a snapshot of "memory.high" and "memory.max".
+struct ByteLimit
+{
+  // Constructs a limitless byte limit.
+  ByteLimit() = default;
+
+  ByteLimit(const Bytes& limit);
+
+  bool operator==(const ByteLimit& other) const;
+
+  // Limit in bytes. None if the limit is "unlimited".
+  Option<Bytes> limit;
+};

Review Comment:
   Similar to `cpu::BandwidthLimit`, a `ByteLimit` can either be some byte 
amount or "max". The idea is to be more explicit about Option<Bytes> 
representing an uncapped limit. 
   
   IIUC we would then have:
   ```c++
   Try<Nothing> set_max(const std::string& cgroup, const Option<Bytes>& limit);
   Result<Bytes> max(const std::string& cgroup); // instead of 
Result<ByteLimit>? 
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to