mirror of
https://github.com/denoland/deno.git
synced 2025-07-24 13:44:08 +00:00
fix(ext/ffi): Remove deno_core::OpState qualifiers, fix ops returning pointer defaults (#17959)
This commit is contained in:
parent
7c090b1b14
commit
4835098cf7
11 changed files with 55 additions and 52 deletions
|
@ -217,8 +217,8 @@ fn get_fast_scalar(s: &str) -> Option<FastValue> {
|
|||
"bool" => Some(FastValue::Bool),
|
||||
"u32" => Some(FastValue::U32),
|
||||
"i32" => Some(FastValue::I32),
|
||||
"u64" => Some(FastValue::U64),
|
||||
"i64" => Some(FastValue::I64),
|
||||
"u64" | "usize" => Some(FastValue::U64),
|
||||
"i64" | "isize" => Some(FastValue::I64),
|
||||
"f32" => Some(FastValue::F32),
|
||||
"f64" => Some(FastValue::F64),
|
||||
"* const c_void" | "* mut c_void" => Some(FastValue::Pointer),
|
||||
|
@ -254,6 +254,16 @@ pub(crate) enum FastValue {
|
|||
Float64Array,
|
||||
}
|
||||
|
||||
impl FastValue {
|
||||
pub fn default_value(&self) -> Quote {
|
||||
match self {
|
||||
FastValue::Pointer => q!({ ::std::ptr::null_mut() }),
|
||||
FastValue::Void => q!({}),
|
||||
_ => q!({ Default::default() }),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for FastValue {
|
||||
fn default() -> Self {
|
||||
Self::Void
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue