mirror of
https://github.com/denoland/rusty_v8.git
synced 2025-02-02 12:49:57 -05:00
Move docs for global to struct (#127)
This commit is contained in:
parent
1507a897de
commit
b00ef1ea3c
1 changed files with 8 additions and 8 deletions
|
@ -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
|
/// 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
|
/// a Local handle only lives as long as the HandleScope in which it was
|
||||||
/// allocated, a global handle remains valid until it is explicitly
|
/// 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
|
/// the garbage collector whenever the object is moved. A new storage
|
||||||
/// cell can be created using the constructor or Global::set and
|
/// cell can be created using the constructor or Global::set and
|
||||||
/// existing handles can be disposed using Global::reset.
|
/// 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> {
|
impl<T> Global<T> {
|
||||||
/// Construct a Global with no storage cell.
|
/// Construct a Global with no storage cell.
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
|
|
Loading…
Add table
Reference in a new issue