]> git.ipfire.org Git - thirdparty/systemd.git/commit
alloc-util: reintroduce malloc_usable_size() into greedy_realloc()
authorLennart Poettering <lennart@poettering.net>
Tue, 30 Apr 2019 08:13:57 +0000 (10:13 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 2 May 2019 12:53:40 +0000 (14:53 +0200)
commite59054270c6e37fd08fdd5d0231edd17c7f7495a
treea15a01fda8868b75233c977d11c42abe88a35717
parent64538af89b4fe72658d7b33e2022d06805badb14
alloc-util: reintroduce malloc_usable_size() into greedy_realloc()

This is another attempt at d4b604baeadbb2498e4f2c3e260260eed210f5d6 and #12438

Instead of blindly using the extra allocated space, let's do so only
after telling libc about it, via a second realloc(). The second
realloc() should be quick, since it never has to copy memory around.
src/basic/alloc-util.c