Status of -fstack-usage?

Ioannis E. Venetis iev@hpclab.ceid.upatras.gr
Wed Jan 18 12:37:00 GMT 2006


Hello,

Having followed this thread and searched a little bit more, I understand 
that -fstack-usage will dump information into a file at compile time. 
However, I was wondering whether something similar would be possible at 
run-time.

I am working on multithreaded libraries and I know that many 
multithreaded languages have compilers that calculate the required stack 
size and pass this information on to the associated library. This way, 
they can handle efficiently memory. However, this is a problem in 
standalone libraries. If we could have something like:

stack_size = __builtin_stack_size(<function>)

that returns the maximum required stack size for <function>, 
multithreaded libraries could take advantage of it at run-time, in order 
to allocate only the amount of required memory.

This is of course not a complete proposal for something, just asking if 
  something like that would be possible at all.

Ioannis



More information about the Gcc mailing list