Page MenuHomeFreeBSD

syslogd: Remove addfile() and free up some memory
ClosedPublic

Authored by jfree on Aug 8 2023, 2:56 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Apr 21, 6:31 AM
Unknown Object (File)
Sun, Apr 21, 6:30 AM
Unknown Object (File)
Sat, Apr 20, 10:03 PM
Unknown Object (File)
Apr 6 2024, 12:44 PM
Unknown Object (File)
Apr 4 2024, 12:36 AM
Unknown Object (File)
Apr 4 2024, 12:36 AM
Unknown Object (File)
Jan 8 2024, 4:48 AM
Unknown Object (File)
Dec 20 2023, 6:19 AM
Subscribers

Details

Summary
cfline() already allocates a filed structure on the heap, so we can
avoid redundant memory allocations by skipping a second calloc() inside
addfile().

addfile() can be removed altogether since a simple STAILQ_INSERT_TAIL()
will add the filed to the global filed list.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Aug 9 2023, 6:50 PM
This revision now requires review to proceed.Aug 10 2023, 10:59 PM
This revision is now accepted and ready to land.Aug 11 2023, 2:31 PM

I think it would have been a bit clearer if D41358 was first, although it's not worth extra effort to recreate the patch set that way.

This revision was automatically updated to reflect the committed changes.