0
0
Fork 0
mirror of https://github.com/denoland/rusty_v8.git synced 2025-01-14 10:02:09 -05:00
denoland-rusty-v8/src/platform.rs

22 lines
463 B
Rust
Raw Normal View History

use crate::support::Opaque;
use crate::support::UniquePtr;
extern "C" {
fn v8__platform__NewDefaultPlatform() -> *mut Platform;
fn v8__Platform__DELETE(this: *mut Platform);
}
pub fn new_default_platform() -> UniquePtr<Platform> {
unsafe { UniquePtr::from_raw(v8__platform__NewDefaultPlatform()) }
}
#[repr(C)]
#[derive(Debug)]
pub struct Platform(Opaque);
impl Drop for Platform {
fn drop(&mut self) {
unsafe { v8__Platform__DELETE(self) }
}
}