add MemoryBlock::Copy function.

This commit is contained in:
hyzboy 2021-03-19 11:24:51 +08:00
parent b8c76fea90
commit 18026cedf8
2 changed files with 8 additions and 0 deletions

View File

@ -34,6 +34,7 @@ namespace hgl
virtual bool Write (const uint64 target,MemoryBlock *source,const uint64 offset,const uint64 size);
virtual bool Exchange(const uint64 target,const uint64 source,const uint64 size);
virtual void Move (const uint64 target,const uint64 source,const uint64 size);
virtual void Copy (const uint64 target,const uint64 source,const uint64 size);
};//class MemoryBlock:public AbstractDataBlock
}//namespace hgl
#endif//HGL_MEMORY_BLOCK_INCLUDE

View File

@ -75,4 +75,11 @@ namespace hgl
Get(source),
size);
}
void MemoryBlock::Copy (const uint64 target,const uint64 source,const uint64 size)
{
memcpy( Get(target),
Get(source),
size);
}
}//namespace hgl