Re: [RFC[ Alloc in vsprintf

From: Linus Torvalds
Date: Sun Jun 26 2022 - 16:54:52 EST


On Sun, Jun 26, 2022 at 1:39 PM Joe Perches <joe@xxxxxxxxxxx> wrote:
>
> OK, and that's true for all the temp stack buffers in every %p<foo>.

Yup.

A lot of them are simply due to it just being simple, and when the
temp buffer is of a fairly limited size, "simple is good".

But yeah, that KSYM_SYMBOL_LEN thing was questionable before, and as
it grows with KSYM_NAME_LEN growing, it's getting pretty ridiculous.

For example, the buffer in "number()" looks very reasonable to me,
since it's not only pretty small (24 bytes on 64-bit architectures).
it has that special alignment requirement too.

So I don't think those temporary stack buffers are necessarily wrong
in general, but there's a point where they go from "ok, there's being
_simple_ and then there's _overly_simplistic_".

Linus