Chromium Code Reviews| Index: src/IceMemory.cpp |
| diff --git a/src/IceMemory.cpp b/src/IceMemory.cpp |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..6dc250c3f2ac1b8d0f99860837d31e5ef8f99ff9 |
| --- /dev/null |
| +++ b/src/IceMemory.cpp |
| @@ -0,0 +1,35 @@ |
| +//===- 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.
|
| +// |
| +// 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) { |
| + 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.
|
| + ICE_TLS_SET_FIELD(CfgAllocator, Allocator); |
| +} |
| + |
| +} // end of namespace Ice |