Re: Question regarding Memory handling

In our previous episode, Olaf Walkowiak said:

> I wrote:
>  
> > Is your motivation in using a pool is to free any outstanding memory when
> > the application or a request dies? I think that is Apache's motivation.
> 
> Not exactly. In my application, some information is passed through
> several stages. There are callback functions for every stage, and
> since one stage has to pass information to the next stages, the
> handlers can`t free the pointers immediately.
> 
> So I'd like to clean up memory after each requesst, making sure I
> don't forget to free something.

What if you use your memory allocation functions on the parts of your
application and let libwww use its own functions? This is what we do
in Amaya.

You could then use the "persistent" pool for the requests and free everything
when the request ends. You can detect this condition either thru a
terminate_handler or by an error return from the function you initially
call (e.g., HTLoad ()) from your application.

-Jose

Received on Thursday, 17 August 2000 10:49:10 UTC