----------------------------------------------------------------------- =========================== MemClear V 2.0 ========================== ----------------------------------------------------------------------- MemClear © Copyright 1991-1994 by Ralf Thanner © Copyright 1997 by Dave Jones ----------------------------------------------------------------------- ================================= Author ============================== ----------------------------------------------------------------------- MemClear V1.7 was written by Ralf Thanner using the Devpac assembler, the original MemClear idea was suggested from MemClear by John Hodgson which had some substancial disadvantages. V1.7 was the final version by Ralf, and unfortunatly, it caused an enforcer hit each time it cleared memory. I mailed Ralf to get his permission to release a new fixed up version, but got no reply, which is unfortunate, as I would have preferred his approval. I also made some optimisations, and removed arp.library support, which means memclear is now Workbench 2.0+ only. As a majority of this program is still the same, it only seemed right to retain as much of the original documentation as possible. ----------------------------------------------------------------------- ================================ Purpose ============================== ----------------------------------------------------------------------- MemClear clears the unused memory chunks with zeros. After clearing memory, it prints the amount of cleared bytes in CHIP and FAST MEMORY and the total amount of free bytes. Due to the fact that MemClear will show you the amount of free memory and the largest chunks you can also use it instead of the Avail command. It can also flush all currently unused devices, libraries and fonts from memory. Memclear is pure, too, and for those reasons a good replacement for Avail. If MemClear finds a difference between the real amount of bytes cleared and the value that is stored in Execbase a warning will be printed out. That means that your memory structure is defect, which was probably caused by a bugged program destroying the memory lists. In most cases your Amiga will crash sooner or later [next time a program uses FreeMem() or AllocMem()]. So if you read the warning it's the best you save all your current work and re-boot your machine. ----------------------------------------------------------------------- ========================= System Requirements ========================= ----------------------------------------------------------------------- MemClear 2.0 works with all Kickstarts above v2.0 and all memory types. ----------------------------------------------------------------------- ================================ Usage ================================ ----------------------------------------------------------------------- MemClear cannot be started from Workbench, it is a Shell tool! The following commands are supported: "AVAIL" - Displays the free memory without clearing. Avail does NOT count the real free bytes. It is just a avail clone. "FLUSH" - Flushing all currently unused devices, libraries and fonts from memory. NOTE: there are some bad written programs which destroy parts of the internal memory lists. These programs WILL cause a crash if memory is flushed (even if you have already 'quitted' them!). You can test it for yourself with the CLI-commands flush and/or avail [FLUSH] from Commodore. After flushing memory MemClear will print how much more memory is free now. "NoClear" - This option is useful if you just want your memory flushed without clearing. Especially if you're using DynamiCache, this option will be very useful in case you just want to flush unused devices, fonts etc. "QUIET" - All actions will be performed silent. Following options are allowed: "F" - Fills only free fast-memory. "C" - Fills only free chip-memory. If you don't want the memory cleared, but rather be filled use a 'FILL VALUE' which is defined this way: "-$FE" - Fills memory with $fe instead of zeros. All hexadecimals are allowed. One single hex value, e.g. '-$b' will be expanded to '$bb'. "-A" - Fills memory with choosen character. This option IS case sensitive. If MemClear is invoked without any option it will simply fill the free memory with zeros and print the (real) free amount of memory. Real free memory means that this is not necessarily the amount of free memory the system has stored in its memheader structure, but rather the amount of bytes encountered in the memory chunks. You can combine fill pattern and area, but only one case sensitive char or one byte hex-value is allowed as pattern, e.g. if you enter just one hex value like '$f' it will be expanded to byte $ff and the memory will be filled with that value. 'MemClear F -a' will fill the fast-mem area with the char 'a' and won't clear a byte in chip memory. 'MemClear FLUSH C -$ff' will first flush unused stuff from memory and then fill all free chip-mem with hex-value '$ff' leaving the fast-mem area untouched. ----------------------------------------------------------------------- =============================== ThanX =============================== ----------------------------------------------------------------------- Ralf Thanner - For all versions of Memclear up till v1.7 ----------------------------------------------------------------------- ============================== History ============================== ----------------------------------------------------------------------- ----- V2.0 ---------------------------------------------------------- - Removed enforcer hit from clear routine. - Removed arp.library support. - Some obvious instruction optimisations. - Aligned all loops onto 32 bit boundaries. ----------------------------------------------------------------------- =========================== MemClear V 2.0 ========================== -----------------------------------------------------------------------