1/* 2 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 15 unchanged lines hidden (view full) --- 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 */ 28 29#ifndef __MEM_RUBY_COMMON_DATABLOCK_HH__ 30#define __MEM_RUBY_COMMON_DATABLOCK_HH__ 31 |
32#include <cassert> |
33#include <iomanip> 34#include <iostream> 35 36#include "mem/ruby/common/TypeDefines.hh" 37 38class DataBlock 39{ 40 public: --- 27 unchanged lines hidden (view full) --- 68 void alloc(); 69 uint8* m_data; 70 bool m_alloc; 71}; 72 73inline void 74DataBlock::assign(uint8* data) 75{ |
76 assert(data != NULL); |
77 if (m_alloc) { 78 delete [] m_data; 79 } 80 m_data = data; 81 m_alloc = false; 82} 83 84inline uint8 --- 32 unchanged lines hidden --- |