This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Finding the amount of free memory (Was: Optimize causes an error.)
- From: Rask Ingemann Lambertsen <rask at sygehus dot dk>
- To: LWATCDR <lwatcdr at gmail dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Wed, 11 Jul 2007 22:08:04 +0200
- Subject: Finding the amount of free memory (Was: Optimize causes an error.)
- References: <8c38cea40707101448n5a9cdbbfp5b1adb366b85281@mail.gmail.com>
On Tue, Jul 10, 2007 at 05:48:49PM -0400, LWATCDR wrote:
>
> And now for a simple question. How the heck to I find out how much
> free memory I have in c?
The short answer: You don't.
> None of the programmers at my office know because we haven't needed to
> check for free memory for many years.
The longer answer: No system with multitasking can answer that question
in any useful way because by the time the return value reaches the tasks
which wants to know, the value is already outdated.
--
Rask Ingemann Lambertsen