mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:27:34 +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
|
@ -45,6 +45,7 @@ public:
|
|||
}
|
||||
|
||||
FlatPtr ptr() const { return m_ptr; }
|
||||
T unsafe_userspace_ptr() const { return (T)m_ptr; }
|
||||
#else
|
||||
Userspace(T ptr)
|
||||
: m_ptr(ptr)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue