<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#c4">Comment # 4</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:cgarcia&#64;igalia.com" title="Carlos Garcia Campos &lt;cgarcia&#64;igalia.com&gt;"> <span class="fn">Carlos Garcia Campos</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=159346#c3">comment #3</a>)
<span class="quote">&gt; Comment on <span class=""><a href="attachment.cgi?id=282540&amp;action=diff" name="attach_282540" title="Patch">attachment 282540</a> <a href="attachment.cgi?id=282540&amp;action=edit" title="Patch">[details]</a></span>
&gt; Patch
&gt; 
&gt; View in context:
&gt; <a href="https://bugs.webkit.org/attachment.cgi?id=282540&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=282540&amp;action=review</a>
&gt; 
&gt; Looking good. One overall suggestion to use Optional rather than -1/0.
&gt; 
&gt; &gt; Source/WebCore/platform/MemoryPressureHandler.h:176
&gt; &gt; +    int m_eventFD { -1 };
&gt; &gt; +    int m_pressureLevelFD { -1 };
&gt; 
&gt; since we are touch these now, can we make it Optional&lt;int&gt; instead of using
&gt; magic -1 or 0?
&gt; 
&gt; It would allow us to if-check
&gt; 
&gt; if (m_eventFD)
&gt; 
&gt; instead of 
&gt; 
&gt; if (m_eventFD != -1)
&gt; 
&gt; Also we could reset with 
&gt; 
&gt; m_eventFD = Nullopt;
&gt; 
&gt; And access its value with either *m_eventFD or m_eventFD.value().
&gt; 
&gt; WDYT?</span >

The thing is that open() returns -1 in case of failure, but we can probably handle that particular case separately and set it to Nullopt.</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>