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)
Tue, Dec 31, 7:50 PM
Unknown Object (File)
Mon, Dec 30, 8:14 PM
Unknown Object (File)
Sun, Dec 29, 7:52 PM
Unknown Object (File)
Sat, Dec 28, 8:17 PM
Unknown Object (File)
Fri, Dec 27, 6:10 AM
Unknown Object (File)
Dec 9 2024, 9:52 PM
Unknown Object (File)
Nov 20 2024, 9:41 PM
Unknown Object (File)
Nov 20 2024, 9:40 PM
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.