DataBlock.cc (8090:722a0d28ee83) DataBlock.cc (9181:42807286d6cb)
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;

--- 73 unchanged lines hidden (view full) ---

82{
83 assert(offset + len <= RubySystem::getBlockSizeBytes());
84 memcpy(&m_data[offset], data, len);
85}
86
87DataBlock &
88DataBlock::operator=(const DataBlock & obj)
89{
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;

--- 73 unchanged lines hidden (view full) ---

82{
83 assert(offset + len <= RubySystem::getBlockSizeBytes());
84 memcpy(&m_data[offset], data, len);
85}
86
87DataBlock &
88DataBlock::operator=(const DataBlock & obj)
89{
90 if (this == &obj) {
91 // assert(false);
92 } else {
93 if (!m_alloc)
94 m_data = new uint8[RubySystem::getBlockSizeBytes()];
95 memcpy(m_data, obj.m_data, RubySystem::getBlockSizeBytes());
96 m_alloc = true;
97 }
98
90 memcpy(m_data, obj.m_data, RubySystem::getBlockSizeBytes());
99 return *this;
100}
91 return *this;
92}