Date: Tue, 23 Mar 93 17:12:32 EST From: DJ Delorie To: tesla AT lamar DOT colostate DOT edu Cc: djgpp AT sun DOT soe DOT clarkson DOT edu Subject: Re: Memory allocation > In one of the gnu news groups someone has asked about a memory allocation > error he is experiencing... It seems that malloc() doesn't run out of > memory... it doesn't return NULL, it just crashes with "Fatal! Disk full > writing to swap file"... Correct. The "out of memory" condition is detected when go32 attempts to page in a page during a page-not-present fault and needs to page something out to free up a memory page. If it can't write the old page to disk, it gives the error. It's a simple algorithm. The correct way to do this is to have sbrk() check the amount of free disk space on each bump and fail if there wouldn't be enough to handle it. However, the stack still expands on its own and may cause memory failure problems the way go32 operates now. Note that the current implementation allows for sparse arrays with no programming :-) > The poster also says that when EMM386 is installed > DJGPP ignores XMS memory. Correct. If you're using an EMS emulator, it must support VCPI. If go32 detect VCPI, it uses VCPI to allocate memory instead of XMS. The memory manager search order is: * VCPI * XMS * VDISK & int15 Go32 currently does not use more than one of these at a time. Perhaps in 2.0. > Although I haven't experienced these problems myself I am very interested in > hearing your thoughts on the possible problems - does DJGPP have a bug? > Is there a patch? This is a "feature" that will (hopefully) be changed soon to act more like Unix. DJ