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)
Wed, Nov 27, 9:32 AM
Unknown Object (File)
Oct 29 2024, 7:36 PM
Unknown Object (File)
Oct 29 2024, 2:06 PM
Unknown Object (File)
Oct 29 2024, 2:06 PM
Unknown Object (File)
Oct 29 2024, 2:06 PM
Unknown Object (File)
Oct 22 2024, 6:16 AM
Unknown Object (File)
Oct 21 2024, 3:58 AM
Unknown Object (File)
Oct 21 2024, 3:53 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.