Skip to content

tree-wide: use reallocarray instead of our home-grown realloc_multiply - #8279

Merged
poettering merged 1 commit into
systemd:masterfrom
keszybz:reallocarray
Feb 26, 2018
Merged

poettering merged 1 commit into
systemd:masterfrom
keszybz:reallocarray

Conversation

@keszybz

@keszybz keszybz commented Feb 26, 2018

Copy link
Copy Markdown
Member

There isn't much difference, but in general we prefer to use the standard
functions. glibc provides reallocarray since version 2.26.

I moved explicit_bzero is configure test to the bottom, so that the two stdlib
functions are at the bottom.

There isn't much difference, but in general we prefer to use the standard
functions. glibc provides reallocarray since version 2.26.

I moved explicit_bzero is configure test to the bottom, so that the two stdlib
functions are at the bottom.
Comment thread meson.build
#include <sys/stat.h>
#include <unistd.h>'''],
['explicit_bzero' , '''#include <string.h>'''],
['reallocarray', '''#include <malloc.h>'''],

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not that it matters, but i figure sooner or later we should sort these alphabetically...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function calls have stubs in missing_syscall.h, and glibc functions get a replacement somewhere in basic/. So I think it's good not to sort them all alphabetically, but to keep the order in missing_syscall.h and here the same.

@poettering poettering added the good-to-merge/waiting-for-ci 👍 PR is good to merge, but CI hasn't passed at time of review. Please merge if you see CI has passed label Feb 26, 2018
@poettering
poettering merged commit aa484f3 into systemd:master Feb 26, 2018
@keszybz keszybz removed the good-to-merge/waiting-for-ci 👍 PR is good to merge, but CI hasn't passed at time of review. Please merge if you see CI has passed label Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants