Slimelite BBS

AllocP32.lha

Back to boot

AllocP32 - BetterAlloc (AllocMem patch fo

Size
8.5K (8,676 bytes)
Added
2026-11-20 17:28
Downloads
1
Long Description
(with the friendly permission of the original author, Andreas Kleinert) _____________________________________________________________________________ New in release 2.01: - Added a workarount for stupid "SaferPatches" clones. _____________________________________________________________________________ New in release 2.00: - Rewritten in assembly language, much shorter file - Tries a partial flush first, instead of removing all libraries on failure. - Removed unnecessary AllocVec patch since it calls AllocMem anyways. - Added workarounds for bugs in the layers.lib _____________________________________________________________________________ AllocP32 will be part of a major memory defragmentizer project still to be published, called PoolMem. Please stay tuned! _____________________________________________________________________________ WARNING: THIS PATCH ISN'T WITHOUT QUIRKS! READ THIS FILE CAREFULLY BEFORE INSTALLING ALLOCP32. REALLY, I MEAN IT! _____________________________________________________________________________ AllocP32 is identical to AllocP EXCEPT that it allocates memory in 32 byte wide blocks to avoid conflicts between PPC and MC68K microprocessors. If you don't have a PPC board, this patch is most likely unnecessary and will only slow down your computer and waste memory. Use AllocP instead. This program is still in an "experimental" phase, even though it has been tested now. No guarantee that this works with a PPC board, I don't have one for testing! (However, it's welcome as a gift.... ;-) _____________________________________________________________________________ Sometimes programs fail with a "not enough memory" error, but after calling "avail flush" the same operation does succeed without problems. If AllocMem routine in the ROMs did not find enough memory, it tries to flush disk based libraries and devices and, afterwards, tries again to reallocate the memory. However, due to a design flaw of the AllocMem() routine, this memory flushing does not have the desired result some- times - even though the libraries have been informed to remove themselves, the memory is not available directly afterwards. The AllocMem() call will fail anyways, EVEN THOUGH the requiested memory will be available immediatly after completion of AllocMem(). The reasons for this strange behaiviour are rather technical and explained below, for the interested user. This patch does ensure that AllocMem/AllocVec won't fail unless there's really no memory available, even by flushing. It does ALSO, and in addition to AllocP, ensure that the allocated memory is contained in 32 byte memory blocks and not on boundaries of these blocks, so match in one cache line of either the PPC or the MC68K microprocessor, not in both. This avoids that parts of the allocated memory is in different caches of the two CPUs and not up-to-date. The patch DOES NOT ensure that the memory is 32 byte aligned! (The current implemenation returns always memory eight bytes on top of a 32 byte boundary, but don't take this for sure!) The patch does NOT apply to structures allocated by the layer library so take care! The reason is a design flaw (avoiding to call this a serious bug) in the layers library, which causes also some trouble for MungWall and MemSniff. See below for what this bug is about. WARNING: Due to this workaround of the layers.libary bug, it is currently NOT allowed to install an AllocMem() patch ON TOP of this one or it will CRASH! If a second patch of AllocMem is unavoidable, run AllocP32 LAST! To find out which patches are installed in your system, get the "SaferPatches" package from my home page at http://www.tu-berlin.de/~thor/thor/index.html or from the AmiNet. Because of the memory alignment, AllocP32 must allocate more memory than requested and will "round up" the memory size to fit entirely in 32 byte blocks. This DOES, of course, waste memory! Don't use this