[PATCH v7 3/4] Add system-wide tunables: Apply tunables part
DJ Delorie
dj@redhat.com
Thu Jun 11 22:24:01 GMT 2026
Adhemerval Zanella Netto <adhemerval.zanella@linaro.org> writes:
>> + if (tunable_list[tid].type.type_code == TUNABLE_TYPE_STRING)
>> + {
>> + /* This is a memory leak but there's no easy way around
>> + it, as the mapping will go away. */
>> + tunable_list[tid].val.strval.str = __strdup (value);
>> + tunable_list[tid].val.strval.len = strlen (value);
>
> And is it fully safe to call malloc here?
I think so, although it may be the rtld internal malloc. We never free
it.
> The cache is now never deallocate,
If the disk file is updated, and the program calls dlopen(), the mapping
is unmapped. If the tunable is accessed after that, it will fault.
At least, that was my thinking.
More information about the Libc-alpha
mailing list