[prev in list] [next in list] [prev in thread] [next in thread] 

List:       webkit-dev
Subject:    Re: [webkit-dev] freeing static variables
From:       Adam Treat <treat () kde ! org>
Date:       2009-07-30 14:26:28
Message-ID: 200907301026.29202.treat () kde ! org
[Download RAW message or body]

On Thursday 30 July 2009 02:55:18 am Zoltan Herczeg wrote:
> Hi,
>
> any thoughts on this? I hope my qestion was clear :) I would like to pack
> the static declarations into wrapper classes, so we can add platform
> and/or compilation mode (debug/release) dependent functionality to all
> static variables (i.e: freeing them on exit).
>
> Zoltan

I've tried this before and it didn't work out so well.  The order in which you 
free them becomes very important and error prone.  

And, of course, whatever solution you make has to be optional and easy to 
maintain as the default policy in WebKit is to not care - by design - about 
cleaning up after static globals on exit as that is left to the OS.

Another strategy for the embedded case where you want to free everything on 
exit is to create a custom memory handler that will do this for you.

Cheers,
Adam
_______________________________________________
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic