Article # 331, added by Geoworks, historical record
| first | previous | index | next | last |

What does HAF_NO_ERR do in MemAlloc



> If I call MemAlloc with HAF_NO_ERR, what will actually happen? Will it
> just wait forever if it can't allocate enough space?

HAF_NO_ERR causes MemAlloc to not return until it can allocate the 
memory.  After several attempts (either 3 or 8, not sure which) to
allocate the memory, the system will put up a SysNotify dialog box
saying the system is out of memory (with the option to reboot or 
retry the attempt to allocate memory).

Just as some background: When MemAlloc fails to find the necessary 
memory, it sleeps the threads for several ticks in hopes that some
other thread will happen to free up memory that it had been using.