|
> Is there a way to check how much memory is still available on the RCX?
This little program scans the memory list and prints the amount of free
memory:
Eddie C. Dost
ecd@skynet.be
--
#include <unistd.h>
#include <stdlib.h>
#include <sys/tm.h>
#include <sys/mm.h>
#include <sys/irq.h>
#include <conio.h>
extern size_t *mm_first_free;
extern size_t mm_start;
int
main(int argc, char **argv)
{
size_t size, total;
size_t *ptr;
total = 0;
ptr = mm_first_free;
while (ptr >= &mm_start) {
if (*(ptr++) == MM_FREE) {
size = *ptr << 1;
total += size;
}
ptr += (*ptr) + 1;
}
total = (total / 1024) * 100 + (total % 1024) / 10;
lcd_number(total, sign, e_2);
return 0;
}
|
|
Message is in Reply To:
9 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|