Page MenuHomeFreeBSD

lib/libc: add recallocarray()
ClosedPublic

Authored by fuz on Thu, Oct 2, 4:25 PM.
Tags
None
Referenced Files
F131516050: D52863.diff
Wed, Oct 8, 8:23 PM
Unknown Object (File)
Sat, Oct 4, 4:53 PM
Unknown Object (File)
Fri, Oct 3, 7:29 PM
Unknown Object (File)
Fri, Oct 3, 2:10 PM
Unknown Object (File)
Fri, Oct 3, 9:46 AM
Unknown Object (File)
Fri, Oct 3, 8:11 AM
Unknown Object (File)
Fri, Oct 3, 4:30 AM
Unknown Object (File)
Thu, Oct 2, 6:48 PM
Subscribers

Details

Summary

This function from OpenBSD is a hybrid of reallocarray() and calloc().
It reallocates an array, clearing any newly allocated items.

The source is taken from lib/libopenbsd, which now no longer has the
function. It ultimately originates from OpenBSD.

A new version FBSD1.9 is added for this FreeBSD 16.0 symbol.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 67507
Build 64390: arc lint + arc unit

Event Timeline

fuz requested review of this revision.Thu, Oct 2, 4:25 PM
lib/libc/Versions.def
56 ↗(On Diff #163363)

This line should be fixed.
Please commit the version addition separately, for MFC.

  • move lib/libc/Versions.def change to D52878
lib/libc/Versions.def
56 ↗(On Diff #163363)

Please offer guidance as to which of the revisions shall be MFC'ed and which not. I am not familiar with the procedure when it comes to backporting FreeBSD 16 symbols to FreeBSD 15.

Both changes (Versions.def) and this one can be MFCed, but we normally do the Versions.def change separately because there might be other symbol in FBSD_1.9 that is merged before your recallocarray.

lib/libc/stdlib/recallocarray.c
41

See my note about merging if()s in other review.

This revision is now accepted and ready to land.Fri, Oct 3, 3:05 AM
  • re-add recallocarray to lib/libopenbsd when bootstrapping (for mandoc)
This revision now requires review to proceed.Fri, Oct 3, 11:14 AM
This revision is now accepted and ready to land.Fri, Oct 3, 5:35 PM
This revision was automatically updated to reflect the committed changes.