Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(870)

Unified Diff: Source/core/rendering/InlineBox.cpp

Issue 16896019: Replace RenderArena with PartitionAlloc. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/rendering/InlineBox.cpp
diff --git a/Source/core/rendering/InlineBox.cpp b/Source/core/rendering/InlineBox.cpp
index 01b0b0a62b8d3d9eb28c061d13a7d9b50f63e7b5..b74155a4aa899523a4b92c15bbb892e08a474178 100644
--- a/Source/core/rendering/InlineBox.cpp
+++ b/Source/core/rendering/InlineBox.cpp
@@ -21,10 +21,10 @@
#include "core/rendering/InlineBox.h"
#include "core/dom/WebCoreMemoryInstrumentation.h"
+#include "core/platform/Partitions.h"
#include "core/platform/graphics/FontMetrics.h"
#include "core/rendering/InlineFlowBox.h"
#include "core/rendering/PaintInfo.h"
-#include "core/rendering/RenderArena.h"
#include "core/rendering/RenderBlock.h"
#include "core/rendering/RootInlineBox.h"
@@ -50,10 +50,6 @@ struct SameSizeAsInlineBox {
COMPILE_ASSERT(sizeof(InlineBox) == sizeof(SameSizeAsInlineBox), InlineBox_size_guard);
#ifndef NDEBUG
-static bool inInlineBoxDetach;
-#endif
-
-#ifndef NDEBUG
InlineBox::~InlineBox()
{
@@ -69,32 +65,22 @@ void InlineBox::remove()
parent()->removeChild(this);
}
-void InlineBox::destroy(RenderArena* renderArena)
+void InlineBox::destroy()
{
-#ifndef NDEBUG
- inInlineBoxDetach = true;
-#endif
delete this;
-#ifndef NDEBUG
- inInlineBoxDetach = false;
-#endif
-
- // Recover the size left there for us by operator delete and free the memory.
- renderArena->free(*(size_t *)this, this);
}
-void* InlineBox::operator new(size_t sz, RenderArena* renderArena)
+#if ENABLE(PARTITION_ALLOC)
+void* InlineBox::operator new(size_t sz)
{
- return renderArena->allocate(sz);
+ return partitionAlloc(Partitions::getRenderingPartition(), sz);
}
-void InlineBox::operator delete(void* ptr, size_t sz)
+void InlineBox::operator delete(void* ptr)
{
- ASSERT(inInlineBoxDetach);
-
- // Stash size where destroy can find it.
- *(size_t *)ptr = sz;
+ partitionFree(ptr);
}
+#endif
#ifndef NDEBUG
const char* InlineBox::boxName() const
@@ -184,11 +170,11 @@ void InlineBox::dirtyLineBoxes()
curr->markDirty();
}
-void InlineBox::deleteLine(RenderArena* arena)
+void InlineBox::deleteLine()
{
if (!m_bitfields.extracted() && m_renderer->isBox())
toRenderBox(m_renderer)->setInlineBoxWrapper(0);
- destroy(arena);
+ destroy();
}
void InlineBox::extractLine()

Powered by Google App Engine
This is Rietveld 408576698