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

Unified Diff: Source/core/rendering/BidiRun.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/BidiRun.cpp
diff --git a/Source/core/rendering/BidiRun.cpp b/Source/core/rendering/BidiRun.cpp
index b75c5bc07325d9a45fee0d021a526bdfe6da6796..53df15bf9d23d8e9b5282e623e9861107cda6a96 100644
--- a/Source/core/rendering/BidiRun.cpp
+++ b/Source/core/rendering/BidiRun.cpp
@@ -23,7 +23,8 @@
#include "config.h"
#include "core/rendering/BidiRun.h"
-#include "core/rendering/RenderArena.h"
+
+#include "core/platform/Partitions.h"
#include <wtf/RefCountedLeakCounter.h>
#include <wtf/StdLibExtras.h>
@@ -33,42 +34,27 @@ namespace WebCore {
DEFINE_DEBUG_ONLY_GLOBAL(RefCountedLeakCounter, bidiRunCounter, ("BidiRun"));
-#ifndef NDEBUG
-static bool inBidiRunDestroy;
-#endif
-
void BidiRun::destroy()
{
-#ifndef NDEBUG
- inBidiRunDestroy = true;
-#endif
- RenderArena* renderArena = m_object->renderArena();
delete this;
-#ifndef NDEBUG
- inBidiRunDestroy = false;
-#endif
-
- // Recover the size left there for us by operator delete and free the memory.
- renderArena->free(*reinterpret_cast<size_t*>(this), this);
}
-void* BidiRun::operator new(size_t sz, RenderArena* renderArena)
+#if ENABLE(PARTITION_ALLOC)
+void* BidiRun::operator new(size_t sz)
{
#ifndef NDEBUG
bidiRunCounter.increment();
#endif
- return renderArena->allocate(sz);
+ return partitionAlloc(Partitions::getRenderingPartition(), sz);
}
-void BidiRun::operator delete(void* ptr, size_t sz)
+void BidiRun::operator delete(void* ptr)
{
#ifndef NDEBUG
bidiRunCounter.decrement();
#endif
- ASSERT(inBidiRunDestroy);
-
- // Stash size where destroy() can find it.
- *(size_t*)ptr = sz;
+ partitionFree(ptr);
}
+#endif
}

Powered by Google App Engine
This is Rietveld 408576698