On 30/08/14 10:42, Steve Fryatt wrote:
> I think it's worth adding that the "many other apps [which] manage to
> release their DAs when documents are closed", referred to by Chris,
> are almost certainly using some kind of sliding block heap (such as
> the ubiquitous flexlib for C) to manage their memory heaps.
The memory allocation/freeing for decoded bitmaps (which are often some
of the bigger allocations NetSurf does), is handled by the front ends.
The core interface is in image/bitmap.h, and the front end should be
able to use a sliding block heap. The one fly in the ointment that I
can see is that the gif decoder, at least, needs to get at the bitmap
data buffer, through bitmap_get_buffer. I think that could be handled
though. Maybe it's worth looking at using a sliding heap for bitmaps on
RISC OS?
> The bottom line is that RISC OS needs to handle malloc()-controlled
> heaps properly: both UnixLib (and the Shared C Library, which has
> similar issues) need to use sparse DAs to release their free memory
> back to the system.
Indeed.
Cheers,
--
Michael Drake http://www.netsurf-browser.org/
No comments:
Post a Comment