[webkit-reviews] review granted: [Bug 52867] OwnArraryPtr.=?UTF-8?Q?h=20uses=20deleteOwnedPtr=20but=20doesn=E2=80=99t=20include=20OwnPtrCommon?=.h : [Attachment 81445] fixed per Darin's comment

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Feb 6 20:40:31 PST 2011


Darin Adler <darin at apple.com> has granted Ryosuke Niwa <rniwa at webkit.org>'s
request for review:
Bug 52867: OwnArraryPtr.h uses deleteOwnedPtr but doesn’t include
OwnPtrCommon.h
https://bugs.webkit.org/show_bug.cgi?id=52867

Attachment 81445: fixed per Darin's comment
https://bugs.webkit.org/attachment.cgi?id=81445&action=review

------- Additional Comments from Darin Adler <darin at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=81445&action=review

> Source/JavaScriptCore/runtime/JSVariableObject.h:165
>      inline void JSVariableObject::setRegisters(Register* registers,
Register* registerArray)
>      {
>	   ASSERT(registerArray != d->registerArray.get());
> -	   d->registerArray.set(registerArray);
> +	   d->registerArray = adoptArrayPtr(registerArray);
>	   d->registers = registers;
>      }

This is OK for landing, but really we need the adoptArrayPtr to be close to the
actual allocation. In this case, setRegisters should be taking a
PassOwnArrayPtr for registerArray. And JSGlobalObject::copyGlobalsFrom should
be getting the register array in an OwnArrayPtr by calling
JSVariableObject::copyRegisterArray. And inside copyRegisterArray, the
adoptArrayPtr should be right there where it calls new.


More information about the webkit-reviews mailing list