[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]
Re: [XaraXtreme-dev] [patch] Have implemented a Linux port of GetMemoryStatus ("Function to find available RAM")
- From: Alex Bligh <alex@xxxxxxxxxxx>
- Date: Sat, 27 May 2006 23:02:36 +0100
- Subject: Re: [XaraXtreme-dev] [patch] Have implemented a Linux port of GetMemoryStatus ("Function to find available RAM")
Israel,
Thanks for this. I will have a look in more detail in the morning but
a couple of comments:
1. (perhaps based on what Phil gave you) it seems to me that
we are doing #ifdef MSW, #elif #WXMAC, #else (assume Linux)
and then processing a /proc file. Well, that means FreeBSD
etc. will fail to compile because hey aren't Mac or MSW.
I think we should instead test for MSW (and use that if so),
then for Linux (explicitly) and use your code, then if that
fails, fail for Mac, FreeBSD etc. as well. That's better than
trying to open files that don't exist on FreeBSD. (I think
the /proc file is not going to exist on FreeBSD etc. - right
Vasil?)
2. Minor nit: if the /proc file fails to open, it seems to me
that haveMemTotal and haveMemFree will be unitialized. They
should I think be initialized to zero, so if the open fails,
the appropriate default routines are called.
Alex