[v3] tunables: sort tunables list (BZ 30027)

Florian Weimer fweimer@redhat.com
Wed Jun 12 19:49:45 GMT 2024


* DJ Delorie:

> Florian Weimer <fweimer@redhat.com> writes:
>> Sorry for the piecewise review,
>
> No problem.
>
>> but there seems to be a types variable reference that the patch
>> doesn't update:
>>
>>     printf (", {TUNABLE_TYPE_%s, %s, %s}, {%s}, {%s}, false, %s},\n",
>> 	    types[t,n,m], minvals[t,n,m], maxvals[t,n,m], default_val[t,n,m],
>> 	    default_val[t,n,m], env_alias[t,n,m]);
>>
>> As the original keys stored in types are destroyed, types[t,n,m]
>> shouldn't work anymore,
>
> asorti() doesn't destroy the source array when you give it two arguments:
>
>> +  # TYPES is an associative array where the index is the data
>> +  # TYPESA is an indexed array where the value is the data
>> +  # We sort TYPESA
>> +  typecount = asorti (types, typesa)
>
> types[] should still be what it always was, after this.

Okay, that explains it.  Please push.

Reviewed-by: Florian Weimer <fweimer@redhat.com>

Thanks,
Florian



More information about the Libc-alpha mailing list