| Age | Commit message (Collapse) | Author |
|
Add comment about division.
Mark error branches with __predict_false().
Reduce one branch with the OR trick.
|
|
|
|
Make this work on !NetBSD platforms:
- replace __CTASSERT() with platform agnostic solution SQRT_SIZE_MAX
- include nbtool_config.h for cross builds to get definition of __RCSID()
- restore errno in the last rare code path for platforms affecting errno(2)
in memcpy(2)
While there: rename parameter name 'num' to 'number' to be in sync with
the calloc(3) parameter naming.
Reported by scole_mail at the current-users ml.
|
|
This change is for safety as memcpy(3) might change it.
Approved by <riastradh>
|
|
checks. Compared to OpenBSD's reallocarray, makes it easier to avoid memory
leaks on allocation failures and it doesn't depend on malloc(0) != NULL
for correct error checking. Compared to plain realloc, it also avoids
the problem of intermediate integer overflows. The trade-off is the use
of void * to side step C type system with regard to generic pointer to
pointer.
|