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

Side by Side 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, 8 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 unified diff | Download patch
« no previous file with comments | « src/IceMemory.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/IceMemory.cpp - Memory management definitions -*- C++ -*-==// 1 //===- subzero/src/IceMemory.cpp - Memory management definitions -*- C++ -*-==//
2 // 2 //
3 // The Subzero Code Generator 3 // The Subzero Code Generator
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 /// 9 ///
10 /// \file 10 /// \file
11 /// \brief Implements memory management related routines for subzero. 11 /// \brief Implements memory management related routines for subzero.
12 ///// 12 /////
13 //===----------------------------------------------------------------------===// 13 //===----------------------------------------------------------------------===//
14 14
15 #include "IceMemory.h" 15 #include "IceMemory.h"
16 16
17 #include "IceCfg.h" 17 #include "IceCfg.h"
18 #include "IceLiveness.h"
18 #include "IceTLS.h" 19 #include "IceTLS.h"
19 20
20 #include <cassert> 21 #include <cassert>
21 #include <utility> 22 #include <utility>
22 23
23 namespace Ice { 24 namespace Ice {
24 ICE_TLS_DEFINE_FIELD(ArenaAllocator *, CfgAllocatorTraits, CfgAllocator); 25 ICE_TLS_DEFINE_FIELD(ArenaAllocator *, CfgAllocatorTraits, CfgAllocator);
25 26
26 CfgAllocatorTraits::allocator_type CfgAllocatorTraits::current() { 27 CfgAllocatorTraits::allocator_type CfgAllocatorTraits::current() {
27 return ICE_TLS_GET_FIELD(CfgAllocator); 28 return ICE_TLS_GET_FIELD(CfgAllocator);
28 } 29 }
29 30
30 void CfgAllocatorTraits::set_current(const manager_type *Manager) { 31 void CfgAllocatorTraits::set_current(const manager_type *Manager) {
31 ArenaAllocator *Allocator = 32 ArenaAllocator *Allocator =
32 Manager == nullptr ? nullptr : Manager->Allocator.get(); 33 Manager == nullptr ? nullptr : Manager->Allocator.get();
33 ICE_TLS_SET_FIELD(CfgAllocator, Allocator); 34 ICE_TLS_SET_FIELD(CfgAllocator, Allocator);
34 } 35 }
35 36
37 ICE_TLS_DEFINE_FIELD(ArenaAllocator *, LivenessAllocatorTraits,
38 LivenessAllocator);
39
40 LivenessAllocatorTraits::allocator_type LivenessAllocatorTraits::current() {
41 return ICE_TLS_GET_FIELD(LivenessAllocator);
42 }
43
44 void LivenessAllocatorTraits::set_current(const manager_type *Manager) {
45 ArenaAllocator *Allocator =
46 Manager == nullptr ? nullptr : Manager->getAllocator();
47 ICE_TLS_SET_FIELD(LivenessAllocator, Allocator);
48 }
36 } // end of namespace Ice 49 } // end of namespace Ice
OLDNEW
« 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