Re: [hatari-devel] Feature idea/question: primitive memory manager

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Am Sat, 30 Dec 2023 10:03:39 +0100
schrieb Miro Kropáček <miro.kropacek@xxxxxxxxx>:

> Hi,
> 
> it's possible this has been discussed/asked in the past (maybe even by
> myself ;-)) but I can't remember anymore.
> 
> Is there any technical reason why Hatari couldn't provide a simple memory
> manager watching an application's memory writes and reporting if writing
> outside of the allocated area? From my naive perspective:
> 
>    - we already parse PRG's header
>    - we can listen to application's Mshrink() so we know the memory region
>    it uses
>    - we can listen to M(x)alloc calls, i.e. we can pair the amount +
>    returned address
>    - we already know which address is memory and which is hardware
>    - we can easily add a simple "if" + some sorted list of allocated places
>    for each memory write
>    - profit?
> 
> This sounds too good to be true. So what am I missing?

 Hi,

not sure whether it is really that simple. Programs also access memory
outside of the above list, like pointers in the cookie jar, the buffer
returned by the Iorec XBIOS function, etc. ... so maybe it's possible to
implement such a feature, but it's certainly a lot of work to get that
really right.

 Thomas



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/