Acorn Arcade forums: Programming: heaps
|
heaps |
|
Loris (13:14 15/5/2003) Phlamethrower (13:25 15/5/2003) john (14:14 15/5/2003)
|
|
Tony Haines |
Message #42123, posted by Loris at 13:14, 15/5/2003 |
Ha ha, me mine, mwahahahaha
Posts: 1025
|
Is it possible to fiddle around with the memory page allocation under RiscOS? I'm wondering whether it would be possible to make some sort of heap which wouldn't fragment. I don't think this is original, but basically the heap manager would fiddle with the physical to logical addressing lookup*, so you could create, release, grow and shrink multiple areas. Albeit only in multiples of the memory page size (4k I think). I'm not claiming I'd be able to do it, just speculating.
*In a similar manner to how apps all think they start at &8000. |
|
[ Log in to reply ] |
|
Jeffrey Lee |
Message #42127, posted by Phlamethrower at 13:25, 15/5/2003, in reply to message #42123 |
Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot stuff
Posts: 15100
|
Yes it's possible, but I dunno how much RISC OS will like it if you tried doing it with application space in the WIMP (e.g. it'll move the pages back to their original locations on a task switch).
However you can get round this by creating a 'custom' dynamic area. This will essentially give you free reign over what the pages map to. I know of at least one program that does this; I think it was for virtual memory, but I can't remember what it was called. Also I don't have any docs on the dynamic area API |
|
[ Log in to reply ] |
|
John D |
Message #42130, posted by john at 14:14, 15/5/2003, in reply to message #42123 |
Member
Posts: 261
|
Someone did this and made the module area like that, only worked on RO3.1 or earlier. You'd only be able to deallocate blocks of 4k or multiples. You can use OS_SetMemMapEntries or something to unmap pages IIRC. It'd work better for some patterns of memory allocation/deallocation than others, and you'd probably be better off writing your own heap management algorithm to try to free up 4K areas rather than conserve address space. Anyway, good luck if you do have a go. |
|
[ Log in to reply ] |
|
|
Acorn Arcade forums: Programming: heaps |