libwapcaplet - memory leak?

Chris Young chris.young at unsatisfactorysoftware.co.uk
Tue Feb 26 20:30:29 GMT 2013


On Tue, 26 Feb 2013 13:11:01 +0000, Rob Kendrick wrote:

> On Tue, Feb 26, 2013 at 01:08:33PM +0000, Daniel Silverstone wrote:
> > If this is *truly* a use-case we need to think about, I'll ponder making the
> > root somehow static so it gets unloaded automatically, although that might
> > complicate rehashing.
> 
> The ugly destructor approach could be workable: if for some reason a
> host's compiler doesn't support it, we can wrap it in a suitable #ifdef
> and they can deal with the leak.

I would have thought a destructor would be the simplest option.

The reason I picked up on this is because I'm doing some experiments
with libwapcaplet and on-chip memory on the AMCC460ex (SAM460), as it
looked a prime candidate for getting a bit of a speed boost.  I
quickly noticed that there was no freeing of the context and bucket,
and therefore no way I could ultimately free the OCM up so other
processes could use it.

I don't think we should be leaking memory at all (even if it is only
4K), but not being able to free a system resource is a major problem.

Chris



More information about the netsurf-dev mailing list