Re: allocate() and free()
- Posted by Robert Craig <rds at RAPIDEUPHORIA.COM> Dec 01, 2000
- 533 views
Derek Parnell writes: > Rob Craig writes: >> I don't know of any language that gives >> heap space back to the operating system. > >The Amiga OS does. > > ...The release_mem() routine gives back > the memory to Windows for other applications to use. release_mem() appears to call Euphoria's free(). Euphoria's free() calls C's free(), which does not give the memory back to the operating system. The memory stays in the heap, ready for use within the same Euphoria program (either for calls to allocate(), or for creating new sequences etc.) C programs on the Amiga or any other system would likely work the same way. The heap memory used by C's malloc() and free() is not returned to the O/S until the application terminates. It's not practical for any O/S to take back a small piece of memory from the middle of your address space. Regards, Rob Craig Rapid Deployment Software http://www.RapidEuphoria.com