-
Notifications
You must be signed in to change notification settings - Fork 126
Open
Description
Lines 333 to 348 in d6c3bd9
/// Retrieves a Handle to the underlying value. | |
/// | |
/// # Safety | |
/// | |
/// This is only safe to do on a rooted object (which Heap is not, it needs | |
/// to be additionally rooted), like RootedGuard, so use this only if you | |
/// know what you're doing. | |
/// | |
/// # Notes | |
/// | |
/// Since Heap values need to be informed when a change to underlying | |
/// value is made (e.g. via `get()`), this does not allow to create | |
/// MutableHandle objects, which can bypass this and lead to crashes. | |
pub unsafe fn handle(&self) -> JS::Handle<T> { | |
JS::Handle::from_marked_location(self.ptr.get() as *const _) | |
} |
I no longer remember when "if you know what you're doing applies", but we have a lot of usages in Servo which makes me nervous.
Metadata
Metadata
Assignees
Labels
No labels