Short: allocates 16-96 bytes for mem-protection, 1.08 Author: pkeunecke@arcor.de (Peter Keunecke) Uploader: pkeunecke@arcor.de (Peter Keunecke) Type: util/boot Version: 1.08 Architecture: m68k-amigaos >= 2.0.4 Changes in 1.08: =============== You may select the trailer size out of a range from 16 to 96. With a size of 0 the AllocMem() patch can be disabled again. Description: =========== MemTrailer is a shell-command for the startup-sequence which patches the AllocMem() and the FreeMem() exec-functions. It adds 16 to 96 bytes as a trailer to prevent trashed memory. Because some programs make illegal accesses past the end of their own memory-allocations or try to use FreeMem() with an unaligned argument pointing a few bytes out of bounds, you may sometimes get a delayed and unexpected Guru-Meditation. With the debug-tools MungWall, WipeOut and MuTools together with SegTracker you can check your system for this type of troublemakers. But these programs are not for permanent use, since they are complex and need quite an amount of CPU-time. In order to use less CPU-time, I made MemTrailer as simple as possible with the intention to fix only the most commonly situations where illegal memory-accesses could occur. Unlike the debugging-tools, MemTrailer never displays any messages. MemTrailer patches AllocMem() to get additional 16-96 bytes for each allocation and sets up a signature pointing to the top of the memblock. These bytes are sacrificed to protect other programs from memory-corruption and the system getting Guru-Meditations. Usually FreeMem() cleans up all as normal. Whenever FreeMem() cannot find a valid signature in the last 6 bytes, all the additional bytes are left behind in memory. But this happens only in very rare cases and then you should select a longer trailer. Normally, there's no fragmentation! Ok, this is not a real memory-protection, but it helps a bit. Since WarpOS has its own memory management, its applications are not affected directly by MemTrailer. Installation and usage: ====================== Copy the command MemTrailer into C: or whereever you like it. Make some tests first, starting MemTrailer from the Shell. I suggest to try out PoolMem for faster memory-allocations. Not needed, if PoolMem does not work reliable on your system. Please, remove all other AllocMem() and FreeMem() patches or at least make sure MemTrailer is installed as the last one. Add a line to your S:startup-sequence close to the bottom or place it after LoadWB and just call "MemTrailer" without Run. With no option you'll get a default trailer size of 16 bytes. Usually, this size is sufficient, but if you need a larger trailer to catch very far memory trashings, you may choose a size of up to 96 by giving the number of bytes as an option. On WarpOS you need a 32-byte alignment: select 32, 64 or 96. S:startup-sequence ================== Setpatch QUIET ... PoolMem >NIL: INSTALL KEEPSORTED PUDDLESIZE 16384 ... LoadWB ... MemTrailer ( or MemTrailer SIZE ) ... EndCLI Once MemTrailer is installed, you can disable the AllocMem() patch by calling "MemTrailer 0". When you activate it later again, then the size will be ignored. You'll get the old one. It would be nice, if you could give me some feedback whether MemTrailer is working on your system and on which hardware and software it runs or not, because the only system where I'm developing and testing my programs is WinUAE and OS 3.9. Distribution: ============ The program and its sourcecode are freeware. I don't give any warranties. You're using the program on your own risk and you are responsible for any damage it could cause to your system! Peter Keunecke .