sc
sc copied to clipboard
sc_sock: use dense events array instead of a sparse one on Windows
Optimization:
- O(1)
sc_sock_poll_add
- work with only
count
events instead ofcap
-
events
array is not sparse anymore -
sc_sock_poll_wait
returns 0 if no events were actually triggered
Codecov Report
Merging #91 (9e4f201) into master (0b74cbc) will not change coverage. The diff coverage is
n/a
.
@@ Coverage Diff @@
## master #91 +/- ##
=======================================
Coverage 99.81% 99.81%
=======================================
Files 21 21
Lines 2192 2192
Branches 385 385
=======================================
Hits 2188 2188
Partials 4 4
Impacted Files | Coverage Δ | |
---|---|---|
socket/sc_sock.c | 100.00% <ø> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 0b74cbc...9e4f201. Read the comment docs.
There is a bug in this PR though: we do not update fdt->index
on the moved last element. Tests do not catch it, probably need to store the pointer to the actual fdt
alongside with data
.
Ok, this approach does not work at all in case when we delete a socket from poll inside of the event loop.