Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 //===- subzero/src/IceMemory.h - Memory management declarations -*- C++ -*-===// | |
|
Jim Stichnoth
2016/02/24 23:23:32
.cpp / definitions
John
2016/02/24 23:46:05
Done.
| |
| 2 // | |
| 3 // The Subzero Code Generator | |
| 4 // | |
| 5 // This file is distributed under the University of Illinois Open Source | |
| 6 // License. See LICENSE.TXT for details. | |
| 7 // | |
| 8 //===----------------------------------------------------------------------===// | |
| 9 /// | |
| 10 /// \file | |
| 11 /// \brief Implements memory management related routines for subzero. | |
| 12 ///// | |
| 13 //===----------------------------------------------------------------------===// | |
| 14 | |
| 15 #include "IceMemory.h" | |
| 16 | |
| 17 #include "IceCfg.h" | |
| 18 #include "IceTLS.h" | |
| 19 | |
| 20 #include <cassert> | |
| 21 #include <utility> | |
| 22 | |
| 23 namespace Ice { | |
| 24 ICE_TLS_DEFINE_FIELD(ArenaAllocator *, CfgAllocatorTraits, CfgAllocator); | |
| 25 | |
| 26 CfgAllocatorTraits::allocator_type CfgAllocatorTraits::current() { | |
| 27 return ICE_TLS_GET_FIELD(CfgAllocator); | |
| 28 } | |
| 29 | |
| 30 void CfgAllocatorTraits::set_current(const manager_type *Manager) { | |
| 31 auto *Allocator = Manager != nullptr ? Manager->Allocator.get() : nullptr; | |
|
Jim Stichnoth
2016/02/24 23:23:32
I would slightly prefer:
Manager == nullptr ? n
John
2016/02/24 23:46:05
Done.
| |
| 32 ICE_TLS_SET_FIELD(CfgAllocator, Allocator); | |
| 33 } | |
| 34 | |
| 35 } // end of namespace Ice | |
| OLD | NEW |