RESOLVED FIXED 129828
Use OwnPtr in StructureIDTable
https://bugs.webkit.org/show_bug.cgi?id=129828
Summary Use OwnPtr in StructureIDTable
Mark Hahnenberg
Reported 2014-03-06 14:29:07 PST
This reduces the amount of boilerplate, plus fixes a memory leak :-(
Attachments
Patch (5.33 KB, patch)
2014-03-06 14:30 PST, Mark Hahnenberg
no flags
Mark Hahnenberg
Comment 1 2014-03-06 14:29:59 PST
Mark Hahnenberg
Comment 2 2014-03-06 14:30:42 PST
Geoffrey Garen
Comment 3 2014-03-06 14:36:47 PST
Comment on attachment 226040 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=226040&action=review r=me > Source/JavaScriptCore/runtime/StructureIDTable.cpp:50 > StructureOrOffset* newTable = new StructureOrOffset[newCapacity]; You should use OwnPtr here. > Source/JavaScriptCore/runtime/StructureIDTable.cpp:59 > + StructureOrOffset* oldTable = m_table.leakPtr(); You should use PassOwnPtr here. Another option is plain old swap.
Mark Hahnenberg
Comment 4 2014-03-07 09:07:58 PST
Mark Hahnenberg
Comment 5 2014-03-07 09:08:16 PST
Comment on attachment 226040 [details] Patch Clearing review flag.
Darin Adler
Comment 6 2014-03-08 21:46:43 PST
In new code, please use std::unique_ptr instead of OwnPtr, which we are planning to deprecate and delete.
Note You need to log in before you can comment on or make changes to this bug.