diff options
author | Rich Felker <dalias@aerifal.cx> | 2018-04-19 20:56:26 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2018-04-19 20:56:26 -0400 |
commit | 72141795d4edd17f88da192447395a48444afa10 (patch) | |
tree | 483162056393cc2f4f380216781726531f76b94e /src/internal/malloc_impl.h | |
parent | 3c2cbbe7ba8b4486299ae0d5336ae01ab520d116 (diff) | |
download | musl-72141795d4edd17f88da192447395a48444afa10.tar.gz musl-72141795d4edd17f88da192447395a48444afa10.tar.bz2 musl-72141795d4edd17f88da192447395a48444afa10.tar.xz musl-72141795d4edd17f88da192447395a48444afa10.zip |
return chunks split off by memalign using __bin_chunk instead of free
this change serves multiple purposes:
1. it ensures that static linking of memalign-family functions will
pull in the system malloc implementation, thereby causing link errors
if an attempt is made to link the system memalign functions with a
replacement malloc (incomplete allocator replacement).
2. it eliminates calls to free that are unpaired with allocations,
which are confusing when setting breakpoints or tracing execution.
as a bonus, making __bin_chunk external may discourage aggressive and
unnecessary inlining of it.
Diffstat (limited to 'src/internal/malloc_impl.h')
-rw-r--r-- | src/internal/malloc_impl.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/internal/malloc_impl.h b/src/internal/malloc_impl.h index 1ea0407c..4c4a4b46 100644 --- a/src/internal/malloc_impl.h +++ b/src/internal/malloc_impl.h @@ -36,4 +36,7 @@ struct bin { #define IS_MMAPPED(c) !((c)->csize & (C_INUSE)) +__attribute__((__visibility__("hidden"))) +void __bin_chunk(struct chunk *); + #endif |