HomeFreeBSD

Unsign some values related to allocation.

Description

Unsign some values related to allocation.

When allocating memory through malloc(9), we always expect the amount of
memory requested to be unsigned as a negative value would either stand for
an error or an overflow.
Unsign some values, found when considering the use of mallocarray(9), to
avoid unnecessary casting. Also consider that indexes should be of
at least the same size/type as the upper limit they pretend to index.

MFC after: 3 weeks

Details

Provenance
pfgAuthored on
Parents
rS328237: Use the __alloc_size2 attribute where relevant.
Branches
Unknown
Tags
Unknown