This makes the code easier to understand and slightly faster,
but requires C23. calloc() would benefit, too, but I didn't
want to touch the imported jemalloc code base.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 67487 Build 64370: arc lint + arc unit
Event Timeline
| lib/libopenbsd/recallocarray.c | ||
|---|---|---|
| 36 | I would wrote if (ckd_mul(&newsize, newnmemb, size) ||
ckd_mul(&oldsize, oldnmemb, size)) {
errno = EINVAL;
return NULL;
}since there are much simpler conditions now. | |
| lib/libopenbsd/recallocarray.c | ||
|---|---|---|
| 36 | This cannot be done as one needs to fail with ENOMEM while the other fails with EINVAL. | |
| lib/libopenbsd/recallocarray.c | ||
|---|---|---|
| 36 | Indeed, missed that. | |