Thol, you got me interested… I played with memory fragmentation a bit and
if I free all the blocks that I allocated the largest chunks recovers
correctly.
Now, of course, if another task happens to be allocating other stuff after
you did you allocating (which is highly probable on the Amiga) then memory
fragmentation is quite possible. i.e. you allocate two chunks of 1 meg
each.. another task just happens to allocate a small chunk in between you
two allocs.. bingo. (of course this is an extreme case, but anything can
happen in a multitasking system)
Khalid. (typing in my sleep again)
I'll need to setup a test program, but what appears to be happening is that
if I call Lock(), then AllocMem(), then UnLock(), then FreeMem(), I get a
change in the largest block available. My code would work just as well
with Lock(), AllocMem(), FreeMem(), UnLock() though I'd have to find
someplace to store the lock in the meantime.
THol() { cout << "Sir, I exist." ;}