Re: API curiosity
- Posted by Robert Craig <rds at RapidEuphoria.com> Feb 14, 2002
- 432 views
Michael J. Sabal writes: > Welcome to the world of Euphoria's garbage collection . Whenever you > use allocate, you should lock the memory location so it doesn't get > swapped out. I honestly can't think of a case where you wouldn't lock > the memory after allocating, but maybe someone else can. 99.9% of users should *never* call lock_memory(). It doesn't even work on WIN32 or Linux, only on DOS. Don't worry, other people have the same misconception. lock_memory() should *only* be used on DOS, and only for a hardware interrupt handler written in Euphoria. lock_memory() is needed in that one, highly-specialized, situation because when a hardware interrupt occurs you don't have the time, or the ability, to make the operating system retrieve a piece of swapped out code or data. In any other situation, it's perfectly ok for memory to be swapped out. That's the operating system's job. Don't worry about it. Euphoria does not garbage collect memory that you allocate(). That's your job, using free(). I don't know why Wolf's code is not working. Regards, Rob Craig Rapid Deployment Software http://www.RapidEuphoria.com