[fpc-pascal] replacement of MemAvail and MaxAvail

Karoly Balogh (Charlie/SGR) charlie at scenergy.dfmk.hu
Fri May 30 12:23:00 CEST 2014


Hi,

On Fri, 30 May 2014, mokashe.ram wrote:

>  Thanks For Your This Prompt Reply...
> but in promgram these functions are already used in my applcation developed
> in TP7, sonow i am migration this applcation to free pascal. how can i
> replace using free pascal?

Michael is right, there's no *real* replacement, because modern OSes
handle the memory differently, and the available memory can change
anytime, even between or during the query function itself... But if you
just want to get the code compiled, with the absolute certainity that it
*will* break runtime, you can for MaxAvail just declare a dummy function
which returns High(LongInt); or some other large constant.

For MemAvail, the problem is that some code uses it to allocate all
available memory in one go, this won't work. But you can still declare a
dummy function, which returns 'some amount', so you can get the code
compiled. However, the original functionality what this code does will not
work, or will not work properly.

Charlie



More information about the fpc-pascal mailing list