lkml.org 
[lkml]   [2010]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] vsprintf.c: Reduce sizeof struct printf_spec from 24 to 8 bytes


On Sat, 6 Mar 2010, Linus Torvalds wrote:

> the 'pointer()' function has a 200+ byte stack footprint on x86-64. And
> vsnprintf itself is about 100+ bytes. So that stack depth is way bigger
> than I would have expected.
>
> I'm not sure _why_ that stack footprint for 'pointer()' is so big, but I
> bet it's due to some simple inlining, and gcc (once more) sucking at it
> and not being able to combine stack frames. It's a damn shame.

Yeah, a few noinline's gets 'pointer()' to just save registers on the
stack, no need for any extra buffers (which then is ok for your recursion
case - the other subfunctions it can call have their own buffers, of
course, but they won't be in the recursive call-path except at the leaf.

vsnprintf() itself seems less obviously fixable. I'm not sure wht gcc
decides it needs 88 bytes of temp-space there.

Linus


\
 
 \ /
  Last update: 2010-03-07 03:27    [W:0.060 / U:2.600 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site