mirror of
https://github.com/systemd/systemd.git
synced 2024-11-01 17:51:22 +03:00
319a4f4bc4
We recently started making more use of malloc_usable_size() and rely on it (see the string_erase() story). Given that we don't really support sytems where malloc_usable_size() cannot be trusted beyond statistics anyway, let's go fully in and rework GREEDY_REALLOC() on top of it: instead of passing around and maintaining the currenly allocated size everywhere, let's just derive it automatically from malloc_usable_size(). I am mostly after this for the simplicity this brings. It also brings minor efficiency improvements I guess, but things become so much nicer to look at if we can avoid these allocation size variables everywhere. Note that the malloc_usable_size() man page says relying on it wasn't "good programming practice", but I think it does this for reasons that don't apply here: the greedy realloc logic specifically doesn't rely on the returned extra size, beyond the fact that it is equal or larger than what was requested. (This commit was supposed to be a quick patch btw, but apparently we use the greedy realloc stuff quite a bit across the codebase, so this ends up touching *a*lot* of code.) |
||
---|---|---|
.. | ||
fuzz-bus-label.c | ||
fuzz-calendarspec.c | ||
fuzz-catalog.c | ||
fuzz-compress.c | ||
fuzz-env-file.c | ||
fuzz-env-file.options | ||
fuzz-fido-id-desc.dict | ||
fuzz-hostname-setup.c | ||
fuzz-json.c | ||
fuzz-main.c | ||
fuzz-time-util.c | ||
fuzz-udev-database.c | ||
fuzz-varlink.c | ||
fuzz.h | ||
meson.build |