ignore pad argument to malloc_trim per glibc

The pad argument is only used by the main arena for sbrk in glibc, with
every other page size gap purged with MADV_DONTNEED. It makes more sense
to simply treat it as an ignored legacy parameter rather than trying to
come up with a sensible way to use it for keeping cached free slabs.
pull/50/head
Daniel Micay 2018-08-30 09:29:15 -04:00
parent af393afc09
commit 3f80895822
1 changed files with 1 additions and 7 deletions

View File

@ -981,13 +981,7 @@ EXPORT int h_mallopt(UNUSED int param, UNUSED int value) {
return 0; return 0;
} }
static const size_t pad_threshold = max_empty_slabs_total * N_SIZE_CLASSES; EXPORT int h_malloc_trim(UNUSED size_t pad) {
EXPORT int h_malloc_trim(size_t pad) {
if (pad > pad_threshold) {
return 0;
}
if (!is_init()) { if (!is_init()) {
return 0; return 0;
} }