[cc65] How to count free memory

Date view Thread view Subject view

From: Tim Schürmann (tischuer_at_web.de)
Date: 2003-02-01 09:49:11


Hi!

Another stupid question about the memory:

In my program i'm doing some wild "malloc" and "free"-actions (please,
don't ask why ;)). Now i want to show the user at runtime(!) how many
memory (in byte) he could actually use.

The best solution seems to be a C-Funktion, which will return the free
bytes as an unsigned int.

My first (trivial) idea was, to "malloc" memory until the
malloc-function returns an error. After that, i free this memory and so
i should know the free bytes.
I think that this solution is not very good (or let's say, i doesn't
like it :)).

Does anybody knows a better solution?

Thanks,

Tim Schürmann
tischuer_at_web.de

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.


Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2003-02-01 09:49:00 CET