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

Unified Diff: src/IceMemory.cpp

Issue 1838973005: Subzero. Liveness memory management. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Addresses comments. Created 4 years, 9 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') | no next file » | 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
index 936a2c820787b4eab4fd967af7aed0b67ccb17ce..57c969ec2860f9ccc03ea077f46cbb1698a8bde4 100644
--- a/src/IceMemory.cpp
+++ b/src/IceMemory.cpp
@@ -15,6 +15,7 @@
#include "IceMemory.h"
#include "IceCfg.h"
+#include "IceLiveness.h"
#include "IceTLS.h"
#include <cassert>
@@ -33,4 +34,16 @@ void CfgAllocatorTraits::set_current(const manager_type *Manager) {
ICE_TLS_SET_FIELD(CfgAllocator, Allocator);
}
+ICE_TLS_DEFINE_FIELD(ArenaAllocator *, LivenessAllocatorTraits,
+ LivenessAllocator);
+
+LivenessAllocatorTraits::allocator_type LivenessAllocatorTraits::current() {
+ return ICE_TLS_GET_FIELD(LivenessAllocator);
+}
+
+void LivenessAllocatorTraits::set_current(const manager_type *Manager) {
+ ArenaAllocator *Allocator =
+ Manager == nullptr ? nullptr : Manager->getAllocator();
+ ICE_TLS_SET_FIELD(LivenessAllocator, Allocator);
+}
} // end of namespace Ice
« no previous file with comments | « src/IceMemory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698