<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - [GLib] Use a GSource instead of a thread to poll memory pressure eventFD in linux implementation"
href="https://bugs.webkit.org/show_bug.cgi?id=159346#c3">Comment # 3</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - [GLib] Use a GSource instead of a thread to poll memory pressure eventFD in linux implementation"
href="https://bugs.webkit.org/show_bug.cgi?id=159346">bug 159346</a>
from <span class="vcard"><a class="email" href="mailto:tonikitoo@webkit.org" title="Antonio Gomes <tonikitoo@webkit.org>"> <span class="fn">Antonio Gomes</span></a>
</span></b>
<pre>Comment on <span class=""><a href="attachment.cgi?id=282540&action=diff" name="attach_282540" title="Patch">attachment 282540</a> <a href="attachment.cgi?id=282540&action=edit" title="Patch">[details]</a></span>
Patch
View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=282540&action=review">https://bugs.webkit.org/attachment.cgi?id=282540&action=review</a>
Looking good. One overall suggestion to use Optional rather than -1/0.
<span class="quote">> Source/WebCore/platform/MemoryPressureHandler.h:176
> + int m_eventFD { -1 };
> + int m_pressureLevelFD { -1 };</span >
since we are touch these now, can we make it Optional<int> instead of using magic -1 or 0?
It would allow us to if-check
if (m_eventFD)
instead of
if (m_eventFD != -1)
Also we could reset with
m_eventFD = Nullopt;
And access its value with either *m_eventFD or m_eventFD.value().
WDYT?</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>