[webkit-dev] Strict OwnPtr now (partially) enabled
abarth at webkit.org
Sun May 1 18:00:38 PDT 2011
Thanks to paroga's help, strict OwnPtrs are now on for everyone. Now
I just need to summon the will to turn on strict PassOwnPtrs...
On Sat, Apr 30, 2011 at 10:45 PM, Adam Barth <abarth at webkit.org> wrote:
> Update: Strict mode for OwnPtr is now turned on for Mac, Chromium, Qt,
> and GTK (thanks Ossy and mrobinson!).
> I'd like to turn this on for all ports early this week. I don't have
> a good way of not breaking the build in platform-specific files that I
> can't build personally.
> If you're interested in a port that's not on the list, please consider
> turning it on for your port (e.g., by creating a bug blocking
> https://bugs.webkit.org/show_bug.cgi?id=59428 and uploading a patch).
> Generally, there shouldn't be too much work to do anymore because most
> files in the project are covered already.
> At some point next week, I'm going to enable strict mode everywhere
> and do battle with the bots.
> On Wed, Apr 27, 2011 at 3:31 PM, Adam Barth <abarth at webkit.org> wrote:
>> Thanks to a bunch of hard work at the WebKit meeting (both as part of
>> the OwnPtr hack-a-thon and "after hours"), we've now enabled strict
>> OwnPtr semantics on PLATFORM(MAC). Other platforms should follow
>> shortly as we work through the platform-specific files.
>> The strict semantics mean you'll no longer be able to store a raw
>> pointer in an OwnPtr without first calling adoptPtr. Ideally, you
>> should call adoptPtr immediately after calling new:
>> adoptPtr(new AwesomeClass(42))
>> OwnPtr will ensure that the allocated memory is freed exactly once,
>> avoiding memory leaks and double-frees. There's still some more work
>> to enable strict mode for PassOwnPtr, but hopefully we'll be able to
>> turn that on soon as well.
>> Thanks for all your help everyone, and happy memory management!
More information about the webkit-dev