<p>Patch set 2:<span style="border-radius: 3px; display: inline-block; margin: 0 2px; padding: 4px;background-color: #ffd4d4;">Code-Review -1</span></p><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/20732">View Change</a></p><p>7 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/20732/2/src/select.c">File src/select.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/libosmocore/+/20732/2/src/select.c@111">Patch Set #2, Line 111:</a> <code style="font-family:monospace,monospace">    llist_for_each_entry(entry, &osmo_fds, list) {</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Indeed looks like we'd want to store that into an rb tree rather than a list.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/libosmocore/+/20732/2/src/select.c@158">Patch Set #2, Line 158:</a> <code style="font-family:monospace,monospace">                                  g_poll.poll_size + POLL_ALLOC_GRANULARITY);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">rather multiply *2?</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/libosmocore/+/20732/2/src/select.c@161">Patch Set #2, Line 161:</a> <code style="font-family:monospace,monospace">         memset(p + g_poll.poll_size, 0, POLL_ALLOC_GRANULARITY*sizeof(struct pollfd));</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Are you sure you can still access g_poll after talloc_realloc? It may have been moved to another region (p) and previous one not available anymore.<br>And in that case you actually need to zero everything, not only new bytes.</p><p style="white-space: pre-wrap; word-wrap: break-word;">spacing *</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/libosmocore/+/20732/2/src/select.c@305">Patch Set #2, Line 305:</a> <code style="font-family:monospace,monospace">                 p->events |= POLLOUT;</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">|= POLLERR ?</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/libosmocore/+/20732/2/src/select.c@312">Patch Set #2, Line 312:</a> <code style="font-family:monospace,monospace">/* iterate over first n_fd entries of g_poll.lopp + dispatch */</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">.poll</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/libosmocore/+/20732/2/src/select.c@328">Patch Set #2, Line 328:</a> <code style="font-family:monospace,monospace">                    /* FD might have been unregistered meanwhile */</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Are you sure this can happen?</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/libosmocore/+/20732/2/src/select.c@363">Patch Set #2, Line 363:</a> <code style="font-family:monospace,monospace">      rc = poll(g_poll.poll, n_poll, polling ? 0 : osmo_timers_nearest_ms());</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Please let's keep both implementations around and decide at compile time which to use. This has several advantatges:</p><ul><li>Debug possible main-loop related bugs due to poll/select</li><li>Allow to run libosmocore on any system supporting select() (virtually all big ones I'm aware of).</li></ul><p style="white-space: pre-wrap; word-wrap: break-word;">It makes no sense to drop support for it given that we already do support it and it's well tested.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmocore/+/20732">change 20732</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/libosmocore/+/20732"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmocore </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I9e80da68a144b36926066610d0d3df06abe09bca </div>
<div style="display:none"> Gerrit-Change-Number: 20732 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Comment-Date: Mon, 19 Oct 2020 09:50:34 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: Yes </div>
<div style="display:none"> Gerrit-MessageType: comment </div>