0
0
Fork 0
mirror of https://github.com/denoland/rusty_v8.git synced 2025-01-23 07:29:56 -05:00

Move docs for global to struct (#127)

This commit is contained in:
Ry Dahl 2019-12-24 09:44:44 -05:00 committed by GitHub
parent 1507a897de
commit b00ef1ea3c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -20,14 +20,6 @@ extern "C" {
);
}
#[repr(C)]
pub struct Global<T> {
value: Option<NonNull<T>>,
isolate: Option<NonNull<Isolate>>,
}
unsafe impl<T> Send for Global<T> {}
/// An object reference that is independent of any handle scope. Where
/// a Local handle only lives as long as the HandleScope in which it was
/// allocated, a global handle remains valid until it is explicitly
@ -38,6 +30,14 @@ unsafe impl<T> Send for Global<T> {}
/// the garbage collector whenever the object is moved. A new storage
/// cell can be created using the constructor or Global::set and
/// existing handles can be disposed using Global::reset.
#[repr(C)]
pub struct Global<T> {
value: Option<NonNull<T>>,
isolate: Option<NonNull<Isolate>>,
}
unsafe impl<T> Send for Global<T> {}
impl<T> Global<T> {
/// Construct a Global with no storage cell.
pub fn new() -> Self {