Merge branch 'master' into memleak2

This commit is contained in:
Nguyen Anh Quynh
2016-02-15 15:52:10 +08:00
26 changed files with 1117 additions and 91 deletions

View File

@@ -86,7 +86,7 @@ void memory_unmap(struct uc_struct *uc, MemoryRegion *mr)
if (uc->mapped_blocks[i] == mr) {
uc->mapped_block_count--;
//shift remainder of array down over deleted pointer
memcpy(&uc->mapped_blocks[i], &uc->mapped_blocks[i + 1], sizeof(MemoryRegion*) * (uc->mapped_block_count - i));
memmove(&uc->mapped_blocks[i], &uc->mapped_blocks[i + 1], sizeof(MemoryRegion*) * (uc->mapped_block_count - i));
mr->destructor(mr);
obj = OBJECT(mr);
obj->ref = 1;