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

Unified Diff: Source/core/rendering/RenderLayer.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/RenderLayer.cpp
diff --git a/Source/core/rendering/RenderLayer.cpp b/Source/core/rendering/RenderLayer.cpp
index 70f6a3e44e358bdcd4586651d1ec5fb1fe8afff1..fc70d00fa86cb4f1ddd6e5371f8185823fd3438f 100644
--- a/Source/core/rendering/RenderLayer.cpp
+++ b/Source/core/rendering/RenderLayer.cpp
@@ -67,6 +67,7 @@
#include "core/page/animation/AnimationController.h"
#include "core/page/scrolling/ScrollingCoordinator.h"
#include "core/platform/HistogramSupport.h"
+#include "core/platform/Partitions.h"
#include "core/platform/PlatformGestureEvent.h"
#include "core/platform/PlatformMouseEvent.h"
#include "core/platform/ScrollAnimator.h"
@@ -89,7 +90,6 @@
#include "core/rendering/HitTestResult.h"
#include "core/rendering/HitTestingTransformState.h"
#include "core/rendering/OverlapTestRequestClient.h"
-#include "core/rendering/RenderArena.h"
#include "core/rendering/RenderFlowThread.h"
#include "core/rendering/RenderGeometryMap.h"
#include "core/rendering/RenderInline.h"
@@ -1627,23 +1627,21 @@ void RenderLayer::beginTransparencyLayers(GraphicsContext* context, const Render
}
}
-void* RenderLayer::operator new(size_t sz, RenderArena* renderArena)
+#if ENABLE(PARTITION_ALLOC)
+void* RenderLayer::operator new(size_t sz)
{
- return renderArena->allocate(sz);
+ return partitionAlloc(Partitions::getRenderingPartition(), sz);
}
-void RenderLayer::operator delete(void* ptr, size_t sz)
+void RenderLayer::operator delete(void* ptr)
{
- // Stash size where destroy can find it.
- *(size_t *)ptr = sz;
+ partitionFree(ptr);
}
+#endif
-void RenderLayer::destroy(RenderArena* renderArena)
+void RenderLayer::destroy()
{
delete this;
-
- // Recover the size left there for us by operator delete and free the memory.
- renderArena->free(*(size_t *)this, this);
}
void RenderLayer::addChild(RenderLayer* child, RenderLayer* beforeChild)

Powered by Google App Engine
This is Rietveld 408576698