Page MenuHomeFreeBSD

Make use of the newly introduce mallocarray(9).
ClosedPublic

Authored by pfg on Jan 10 2018, 8:15 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 20, 9:41 PM
Unknown Object (File)
Wed, Nov 20, 9:40 PM
Unknown Object (File)
Oct 7 2024, 3:48 AM
Unknown Object (File)
Oct 7 2024, 3:48 AM
Unknown Object (File)
Oct 7 2024, 3:48 AM
Unknown Object (File)
Oct 7 2024, 3:24 AM
Unknown Object (File)
Oct 5 2024, 4:23 AM
Unknown Object (File)
Oct 5 2024, 1:57 AM
Subscribers

Details

Summary

Not sure there is any chance of an overflow here but perhaps this also
makes the code easier to read.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Why didn't they provide a calloc(), to follow the malloc()/free() pattern?

(It looks like this was introduced in rS327674)

This revision is now accepted and ready to land.Jan 10 2018, 9:54 PM
In D13833#290191, @erj wrote:

Why didn't they provide a calloc(), to follow the malloc()/free() pattern?

(It looks like this was introduced in rS327674)

And I forgot that not everyone wants the memory they allocate to be zeroed, though the driver zeroes it in all of the calls that are being replaced here.

This revision was automatically updated to reflect the committed changes.