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

Unified Diff: Source/core/rendering/LayoutState.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/LayoutState.cpp
diff --git a/Source/core/rendering/LayoutState.cpp b/Source/core/rendering/LayoutState.cpp
index 8dd2d0c711cc18cd1ac0edd766b86759bc707a47..ad4daff8b8726b9603aa341c50cf255dbba4df99 100644
--- a/Source/core/rendering/LayoutState.cpp
+++ b/Source/core/rendering/LayoutState.cpp
@@ -26,8 +26,8 @@
#include "config.h"
#include "core/rendering/LayoutState.h"
+#include "core/platform/Partitions.h"
#include "core/rendering/ColumnInfo.h"
-#include "core/rendering/RenderArena.h"
#include "core/rendering/RenderInline.h"
#include "core/rendering/RenderLayer.h"
#include "core/rendering/RenderView.h"
@@ -161,32 +161,22 @@ LayoutState::LayoutState(RenderObject* root)
}
}
-#ifndef NDEBUG
-static bool inLayoutStateDestroy;
-#endif
-
-void LayoutState::destroy(RenderArena* renderArena)
+void LayoutState::destroy()
{
-#ifndef NDEBUG
- inLayoutStateDestroy = true;
-#endif
delete this;
-#ifndef NDEBUG
- inLayoutStateDestroy = false;
-#endif
- renderArena->free(*(size_t*)this, this);
}
-void* LayoutState::operator new(size_t sz, RenderArena* renderArena)
+#if ENABLE(PARTITION_ALLOC)
+void* LayoutState::operator new(size_t sz)
{
- return renderArena->allocate(sz);
+ return partitionAlloc(Partitions::getRenderingPartition(), sz);
}
-void LayoutState::operator delete(void* ptr, size_t sz)
+void LayoutState::operator delete(void* ptr)
{
- ASSERT(inLayoutStateDestroy);
- *(size_t*)ptr = sz;
+ partitionFree(ptr);
}
+#endif
void LayoutState::clearPaginationInformation()
{

Powered by Google App Engine
This is Rietveld 408576698