This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Status of -fstack-usage?
- From: "Ioannis E. Venetis" <iev at hpclab dot ceid dot upatras dot gr>
- To: gcc at gcc dot gnu dot org
- Date: Wed, 18 Jan 2006 14:37:12 +0200
- Subject: Re: Status of -fstack-usage?
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