Please enable JavaScript to view this site.

ESL Documentation

The squeeze memory action statement reorders the available memory in a program so that no fragmentation exists. This action takes a few seconds to execute, so do not use it unless you have to.

In the following example, the integer variable SizeNeeded contains the exact amount of memory needed. The boolean true is copied to the variable MemoryOK if there is enough memory for an operation that would use SizeNeeded bytes.

If there is not enough room, ESL will squeeze memory to try to create the needed memory. If the program still does not have enough memory after the squeeze, the boolean false is copied to MemoryOK.

Example

action CheckMemory is

 if (freesize >= SizeNeeded) 

         then copy true to MemoryOK

 else

         squeeze memory

         if (freesize >= SizeNeeded) 

                 then copy true to MemoryOK

         else

                 copy false to MemoryOK

         end if

 end if

ESL automatically implements the squeeze memory function after you compile your program, and when you specify a save program as statement.