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

Unified Diff: src/IceMemory.cpp

Issue 1738443002: Subzero. Performance tweaks. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Addresses comments -- all of them Created 4 years, 10 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
« no previous file with comments | « src/IceMemory.h ('k') | src/IceOperand.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceMemory.cpp
diff --git a/src/IceMemory.cpp b/src/IceMemory.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..936a2c820787b4eab4fd967af7aed0b67ccb17ce
--- /dev/null
+++ b/src/IceMemory.cpp
@@ -0,0 +1,36 @@
+//===- subzero/src/IceMemory.cpp - Memory management definitions -*- C++ -*-==//
+//
+// The Subzero Code Generator
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// \brief Implements memory management related routines for subzero.
+/////
+//===----------------------------------------------------------------------===//
+
+#include "IceMemory.h"
+
+#include "IceCfg.h"
+#include "IceTLS.h"
+
+#include <cassert>
+#include <utility>
+
+namespace Ice {
+ICE_TLS_DEFINE_FIELD(ArenaAllocator *, CfgAllocatorTraits, CfgAllocator);
+
+CfgAllocatorTraits::allocator_type CfgAllocatorTraits::current() {
+ return ICE_TLS_GET_FIELD(CfgAllocator);
+}
+
+void CfgAllocatorTraits::set_current(const manager_type *Manager) {
+ ArenaAllocator *Allocator =
+ Manager == nullptr ? nullptr : Manager->Allocator.get();
+ ICE_TLS_SET_FIELD(CfgAllocator, Allocator);
+}
+
+} // end of namespace Ice
« no previous file with comments | « src/IceMemory.h ('k') | src/IceOperand.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698