• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

c-ares / c-ares / 12341005525
92%

Build:
DEFAULT BRANCH: main
Ran 15 Dec 2024 05:58PM UTC
Jobs 1
Files 178
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

15 Dec 2024 05:55PM UTC coverage: 91.305% (-0.02%) from 91.321%
12341005525

push

github

web-flow
ares_buf: turn off buffering when loading a file (#939)

The commit is a small optimization in how a file is loaded into memory.

`FILE` buffering is just a libc (or user) provided buffer that
transparently reduces (typically) the number of system calls to I/O.
`fseek()` is not affected (not because `fseek()` will not perform I/O
but because it won't use that buffer, apart from potentially flushing
it).

In this case we predetermine the number of bytes to read (the entire
file) and then we load the entire file in one `fread()`, and in this
case buffering can only hurt: it results in multiple system `read()`
calls instead of a single `read()`, as well as copying each read byte
from the I/O buffer to the `fread()` buffer.

Furthermore, the `setvbuf()` call eagerly (before `fclose()`) releases
the buffer memory back to the system (at least `BUFSIZ` >= 256 bytes).
Releasing memory eagerly before performing I/O may be advantageous on a
low-memory system with slow I/O.

Signed-off-by: Nikolaos Chatzikonstantinou (@createyourpersonalaccount)

1 of 1 new or added line in 1 file covered. (100.0%)

4 existing lines in 2 files now uncovered.

22200 of 24314 relevant lines covered (91.31%)

11885.66 hits per line

Uncovered Existing Lines

Lines Coverage ∆ File
1
87.56
-0.1% src/lib/record/ares_dns_record.c
3
63.1
-0.55% src/lib/record/ares_dns_mapping.c
Jobs
ID Job ID Ran Files Coverage
1 12341005525.1 15 Dec 2024 05:58PM UTC 939
59.67
GitHub Action Run
Source Files on build 12341005525
  • Tree
  • List 178
  • Changed 110
  • Source Changed 0
  • Coverage Changed 54
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • ffc2570d on github
  • Prev Build on main (#12334759771)
  • Next Build on main (#12341009114)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc