HomeFreeBSD

fread: improve performance for unbuffered reads

Description

fread: improve performance for unbuffered reads

We can use the buffer passed to fread(3) directly in the FILE *.
The buffer needs to be reset before each call to __srefill().
This preserves the expected behavior in all cases.

The change was found originally in OpenBSD and later adopted by NetBSD.

MFC after: 2 weeks
Obtained from: OpenBSD (CVS 1.18)

Differential Revision: https://reviews.freebsd.org/D30548

Details

Provenance
pfgAuthored on May 31 2021, 1:48 AM
Differential Revision
D30548: fread: improve performance for unbuffered reads
Parents
rG0f86492b09ca: pf: Fix more ioctl memory leaks
Branches
Unknown
Tags
Unknown