mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 867530 - Make the current poison consumers use the new API. r=roc
This commit is contained in:
parent
40741f4bf9
commit
10834724ee
@ -108,11 +108,7 @@ nsPresArena::Free(uint32_t aCode, void* aPtr)
|
||||
NS_ABORT_IF_FALSE(list, "no free list for pres arena object");
|
||||
NS_ABORT_IF_FALSE(list->mEntrySize > 0, "PresArena cannot free zero bytes");
|
||||
|
||||
char* p = reinterpret_cast<char*>(aPtr);
|
||||
char* limit = p + list->mEntrySize;
|
||||
for (; p < limit; p += sizeof(uintptr_t)) {
|
||||
*reinterpret_cast<uintptr_t*>(p) = mozPoisonValue();
|
||||
}
|
||||
mozWritePoison(aPtr, list->mEntrySize);
|
||||
|
||||
MOZ_MAKE_MEM_NOACCESS(aPtr, list->mEntrySize);
|
||||
list->mEntries.AppendElement(aPtr);
|
||||
|
@ -4,8 +4,8 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsRuleData.h"
|
||||
#include "nsPresArena.h"
|
||||
|
||||
#include "mozilla/Poison.h"
|
||||
#include "mozilla/StandardInteger.h"
|
||||
|
||||
inline size_t
|
||||
@ -20,7 +20,7 @@ nsRuleData::GetPoisonOffset()
|
||||
"expect uintptr_t to be unsigned");
|
||||
MOZ_STATIC_ASSERT(size_t(-1) > size_t(0),
|
||||
"expect size_t to be unsigned");
|
||||
uintptr_t framePoisonValue = nsPresArena::GetPoisonValue();
|
||||
uintptr_t framePoisonValue = mozPoisonValue();
|
||||
return size_t(framePoisonValue - uintptr_t(mValueStorage)) /
|
||||
sizeof(nsCSSValue);
|
||||
}
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/DebugOnly.h"
|
||||
#include "mozilla/Likely.h"
|
||||
#include "mozilla/Poison.h"
|
||||
#include "nsIWidget.h"
|
||||
#include "nsViewManager.h"
|
||||
#include "nsIFrame.h"
|
||||
@ -132,14 +133,7 @@ nsView* nsView::GetViewFor(nsIWidget* aWidget)
|
||||
void nsView::Destroy()
|
||||
{
|
||||
this->~nsView();
|
||||
|
||||
const uintptr_t POISON = nsPresArena::GetPoisonValue();
|
||||
char* p = reinterpret_cast<char*>(this);
|
||||
char* limit = p + sizeof(*this);
|
||||
for (; p < limit; p += sizeof(uintptr_t)) {
|
||||
*reinterpret_cast<uintptr_t*>(p) = POISON;
|
||||
}
|
||||
|
||||
mozWritePoison(this, sizeof(*this));
|
||||
nsView::operator delete(this);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user