W3C home > Mailing lists > Public > www-lib@w3.org > July to September 2000

Re: Question regarding Memory handling

From: <jose.kahan@w3.org>
Date: Thu, 17 Aug 2000 16:49:03 +0200 (MET DST)
Message-Id: <200008171449.QAA09080@tuvalu.inrialpes.fr>
To: Olaf Walkowiak <olaf@sevenval.de>
CC: www-lib@w3.org
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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 23 April 2007 18:18:37 GMT