kernel: Use memcpy() when cloning UserVM
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This way, any future fields in VMRegion get copied automatically.
This commit is contained in:
parent
67ed18629d
commit
3a3473b9c2
@ -49,13 +49,9 @@ Result<OwnedPtr<UserVM>> UserVM::clone()
|
||||
|
||||
for (const auto* region : m_regions)
|
||||
{
|
||||
auto* copied_region = TRY(make<VMRegion>());
|
||||
copied_region->start = region->start;
|
||||
copied_region->end = region->end;
|
||||
copied_region->count = region->count;
|
||||
copied_region->used = region->used;
|
||||
copied_region->persistent = region->persistent;
|
||||
ptr->m_regions.append(copied_region);
|
||||
auto* new_region = TRY(make<VMRegion>());
|
||||
memcpy(new_region, region, sizeof(*region));
|
||||
ptr->m_regions.append(new_region);
|
||||
}
|
||||
|
||||
return move(ptr);
|
||||
|
Loading…
Reference in New Issue
Block a user