mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 15:48:12 +00:00
Kernel+AK: Add and use Userspace<T>::unsafe_userspace_ptr()
Since we already have the type information in the Userspace template, it was a bit silly to cast manually everywhere. Just add a sufficiently scary-sounding getter for a typed pointer. Thanks @alimpfard for pointing out that I was being silly with tossing out the type. In the future we may want to make this API non-public as well.
This commit is contained in:
parent
5cd7159629
commit
628b3badfb
4 changed files with 13 additions and 12 deletions
|
@ -57,7 +57,7 @@ ssize_t Process::sys$read(int fd, Userspace<u8*> buffer, ssize_t size)
|
|||
}
|
||||
}
|
||||
// FIXME: We should have a read() that takes a Userspace<u8*>
|
||||
return description->read((u8*)buffer.ptr(), size);
|
||||
return description->read(buffer.unsafe_userspace_ptr(), size);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue