To protect your data, the CISO officer has suggested users to enable GitLab 2FA as soon as possible.

Commit cb708ec4 authored by Kunshan Wang's avatar Kunshan Wang
Browse files

API-GEN: Rewrite muapi2rustapi.py; immutablise

Re-wrote the muapi2rustapi.py script.

Use *const for CStrings and CMuValue.
parent b4328c44
......@@ -67,55 +67,55 @@ impl MuCtx {
panic!("Not implemented")
}
pub fn handle_from_sint8(&mut self, num: i8, len: c_int) -> *mut APIMuValue {
pub fn handle_from_sint8(&mut self, num: i8, len: c_int) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn handle_from_uint8(&mut self, num: u8, len: c_int) -> *mut APIMuValue {
pub fn handle_from_uint8(&mut self, num: u8, len: c_int) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn handle_from_sint16(&mut self, num: i16, len: c_int) -> *mut APIMuValue {
pub fn handle_from_sint16(&mut self, num: i16, len: c_int) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn handle_from_uint16(&mut self, num: u16, len: c_int) -> *mut APIMuValue {
pub fn handle_from_uint16(&mut self, num: u16, len: c_int) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn handle_from_sint32(&mut self, num: i32, len: c_int) -> *mut APIMuValue {
pub fn handle_from_sint32(&mut self, num: i32, len: c_int) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn handle_from_uint32(&mut self, num: u32, len: c_int) -> *mut APIMuValue {
pub fn handle_from_uint32(&mut self, num: u32, len: c_int) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn handle_from_sint64(&mut self, num: i64, len: c_int) -> *mut APIMuValue {
pub fn handle_from_sint64(&mut self, num: i64, len: c_int) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn handle_from_uint64(&mut self, num: u64, len: c_int) -> *mut APIMuValue {
pub fn handle_from_uint64(&mut self, num: u64, len: c_int) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn handle_from_uint64s(&mut self, nums: &[u64], len: c_int) -> *mut APIMuValue {
pub fn handle_from_uint64s(&mut self, nums: &[u64], len: c_int) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn handle_from_float(&mut self, num: f32) -> *mut APIMuValue {
pub fn handle_from_float(&mut self, num: f32) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn handle_from_double(&mut self, num: f64) -> *mut APIMuValue {
pub fn handle_from_double(&mut self, num: f64) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn handle_from_ptr(&mut self, mu_type: MuID, ptr: CMuCPtr) -> *mut APIMuValue {
pub fn handle_from_ptr(&mut self, mu_type: MuID, ptr: CMuCPtr) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn handle_from_fp(&mut self, mu_type: MuID, fp: CMuCFP) -> *mut APIMuValue {
pub fn handle_from_fp(&mut self, mu_type: MuID, fp: CMuCFP) -> *const APIMuValue {
panic!("Not implemented")
}
......@@ -167,19 +167,19 @@ impl MuCtx {
panic!("Not implemented")
}
pub fn handle_from_const(&mut self, id: MuID) -> *mut APIMuValue {
pub fn handle_from_const(&mut self, id: MuID) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn handle_from_global(&mut self, id: MuID) -> *mut APIMuValue {
pub fn handle_from_global(&mut self, id: MuID) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn handle_from_func(&mut self, id: MuID) -> *mut APIMuValue {
pub fn handle_from_func(&mut self, id: MuID) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn handle_from_expose(&mut self, id: MuID) -> *mut APIMuValue {
pub fn handle_from_expose(&mut self, id: MuID) -> *const APIMuValue {
panic!("Not implemented")
}
......@@ -195,55 +195,55 @@ impl MuCtx {
panic!("Not implemented")
}
pub fn extract_value(&mut self, str: &APIMuValue, index: c_int) -> *mut APIMuValue {
pub fn extract_value(&mut self, str: &APIMuValue, index: c_int) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn insert_value(&mut self, str: &APIMuValue, index: c_int, newval: &APIMuValue) -> *mut APIMuValue {
pub fn insert_value(&mut self, str: &APIMuValue, index: c_int, newval: &APIMuValue) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn extract_element(&mut self, str: &APIMuValue, index: &APIMuValue) -> *mut APIMuValue {
pub fn extract_element(&mut self, str: &APIMuValue, index: &APIMuValue) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn insert_element(&mut self, str: &APIMuValue, index: &APIMuValue, newval: &APIMuValue) -> *mut APIMuValue {
pub fn insert_element(&mut self, str: &APIMuValue, index: &APIMuValue, newval: &APIMuValue) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn new_fixed(&mut self, mu_type: MuID) -> *mut APIMuValue {
pub fn new_fixed(&mut self, mu_type: MuID) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn new_hybrid(&mut self, mu_type: MuID, length: &APIMuValue) -> *mut APIMuValue {
pub fn new_hybrid(&mut self, mu_type: MuID, length: &APIMuValue) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn refcast(&mut self, opnd: &APIMuValue, new_type: MuID) -> *mut APIMuValue {
pub fn refcast(&mut self, opnd: &APIMuValue, new_type: MuID) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn get_iref(&mut self, opnd: &APIMuValue) -> *mut APIMuValue {
pub fn get_iref(&mut self, opnd: &APIMuValue) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn get_field_iref(&mut self, opnd: &APIMuValue, field: c_int) -> *mut APIMuValue {
pub fn get_field_iref(&mut self, opnd: &APIMuValue, field: c_int) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn get_elem_iref(&mut self, opnd: &APIMuValue, index: &APIMuValue) -> *mut APIMuValue {
pub fn get_elem_iref(&mut self, opnd: &APIMuValue, index: &APIMuValue) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn shift_iref(&mut self, opnd: &APIMuValue, offset: &APIMuValue) -> *mut APIMuValue {
pub fn shift_iref(&mut self, opnd: &APIMuValue, offset: &APIMuValue) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn get_var_part_iref(&mut self, opnd: &APIMuValue) -> *mut APIMuValue {
pub fn get_var_part_iref(&mut self, opnd: &APIMuValue) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn load(&mut self, ord: CMuMemOrd, loc: &APIMuValue) -> *mut APIMuValue {
pub fn load(&mut self, ord: CMuMemOrd, loc: &APIMuValue) -> *const APIMuValue {
panic!("Not implemented")
}
......@@ -251,11 +251,11 @@ impl MuCtx {
panic!("Not implemented")
}
pub fn cmpxchg(&mut self, ord_succ: CMuMemOrd, ord_fail: CMuMemOrd, weak: bool, loc: &APIMuValue, expected: &APIMuValue, desired: &APIMuValue, is_succ: *mut CMuBool) -> *mut APIMuValue {
pub fn cmpxchg(&mut self, ord_succ: CMuMemOrd, ord_fail: CMuMemOrd, weak: bool, loc: &APIMuValue, expected: &APIMuValue, desired: &APIMuValue, is_succ: *mut CMuBool) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn atomicrmw(&mut self, ord: CMuMemOrd, op: CMuAtomicRMWOptr, loc: &APIMuValue, opnd: &APIMuValue) -> *mut APIMuValue {
pub fn atomicrmw(&mut self, ord: CMuMemOrd, op: CMuAtomicRMWOptr, loc: &APIMuValue, opnd: &APIMuValue) -> *const APIMuValue {
panic!("Not implemented")
}
......@@ -263,15 +263,15 @@ impl MuCtx {
panic!("Not implemented")
}
pub fn new_stack(&mut self, func: &APIMuValue) -> *mut APIMuValue {
pub fn new_stack(&mut self, func: &APIMuValue) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn new_thread_nor(&mut self, stack: &APIMuValue, threadlocal: Option<&APIMuValue>, vals: Vec<&APIMuValue>) -> *mut APIMuValue {
pub fn new_thread_nor(&mut self, stack: &APIMuValue, threadlocal: Option<&APIMuValue>, vals: Vec<&APIMuValue>) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn new_thread_exc(&mut self, stack: &APIMuValue, threadlocal: Option<&APIMuValue>, exc: &APIMuValue) -> *mut APIMuValue {
pub fn new_thread_exc(&mut self, stack: &APIMuValue, threadlocal: Option<&APIMuValue>, exc: &APIMuValue) -> *const APIMuValue {
panic!("Not implemented")
}
......@@ -283,11 +283,11 @@ impl MuCtx {
panic!("Not implemented")
}
pub fn get_threadlocal(&mut self, thread: &APIMuValue) -> *mut APIMuValue {
pub fn get_threadlocal(&mut self, thread: &APIMuValue) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn new_cursor(&mut self, stack: &APIMuValue) -> *mut APIMuValue {
pub fn new_cursor(&mut self, stack: &APIMuValue) -> *const APIMuValue {
panic!("Not implemented")
}
......@@ -295,7 +295,7 @@ impl MuCtx {
panic!("Not implemented")
}
pub fn copy_cursor(&mut self, cursor: &APIMuValue) -> *mut APIMuValue {
pub fn copy_cursor(&mut self, cursor: &APIMuValue) -> *const APIMuValue {
panic!("Not implemented")
}
......@@ -339,31 +339,31 @@ impl MuCtx {
panic!("Not implemented")
}
pub fn tr64_to_fp(&mut self, value: &APIMuValue) -> *mut APIMuValue {
pub fn tr64_to_fp(&mut self, value: &APIMuValue) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn tr64_to_int(&mut self, value: &APIMuValue) -> *mut APIMuValue {
pub fn tr64_to_int(&mut self, value: &APIMuValue) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn tr64_to_ref(&mut self, value: &APIMuValue) -> *mut APIMuValue {
pub fn tr64_to_ref(&mut self, value: &APIMuValue) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn tr64_to_tag(&mut self, value: &APIMuValue) -> *mut APIMuValue {
pub fn tr64_to_tag(&mut self, value: &APIMuValue) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn tr64_from_fp(&mut self, value: &APIMuValue) -> *mut APIMuValue {
pub fn tr64_from_fp(&mut self, value: &APIMuValue) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn tr64_from_int(&mut self, value: &APIMuValue) -> *mut APIMuValue {
pub fn tr64_from_int(&mut self, value: &APIMuValue) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn tr64_from_ref(&mut self, reff: &APIMuValue, tag: &APIMuValue) -> *mut APIMuValue {
pub fn tr64_from_ref(&mut self, reff: &APIMuValue, tag: &APIMuValue) -> *const APIMuValue {
panic!("Not implemented")
}
......@@ -375,7 +375,7 @@ impl MuCtx {
panic!("Not implemented")
}
pub fn pin(&mut self, loc: &APIMuValue) -> *mut APIMuValue {
pub fn pin(&mut self, loc: &APIMuValue) -> *const APIMuValue {
panic!("Not implemented")
}
......@@ -383,11 +383,11 @@ impl MuCtx {
panic!("Not implemented")
}
pub fn get_addr(&mut self, loc: &APIMuValue) -> *mut APIMuValue {
pub fn get_addr(&mut self, loc: &APIMuValue) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn expose(&mut self, func: &APIMuValue, call_conv: CMuCallConv, cookie: &APIMuValue) -> *mut APIMuValue {
pub fn expose(&mut self, func: &APIMuValue, call_conv: CMuCallConv, cookie: &APIMuValue) -> *const APIMuValue {
panic!("Not implemented")
}
......
......@@ -190,7 +190,7 @@ fn to_MuID(value: MuID) -> CMuID {
}
#[inline(always)]
fn to_handle(muvalue: *mut APIMuValue) -> CMuValue {
fn to_handle(muvalue: *const APIMuValue) -> CMuValue {
debug_assert!(!muvalue.is_null());
muvalue as CMuValue
}
......
......@@ -41,8 +41,15 @@ pub type CMuTrapHandler = extern fn(
// input parameter (userdata)
CMuCPtr);
// some hand-written pointer types
/// C strings should not be changed by the callee, whether the callee is in C or Mu.
pub type CMuCString = *const c_char;
/// Handles are immutable from both the micro VM and the client's point of view.
pub type CMuValue = *const c_void;
// GEN:BEGIN:Types
pub type CMuValue = *mut c_void;
pub type CMuSeqValue = CMuValue;
pub type CMuGenRefValue = CMuValue;
pub type CMuIntValue = CMuValue;
......@@ -61,7 +68,6 @@ pub type CMuThreadRefValue = CMuGenRefValue;
pub type CMuStackRefValue = CMuGenRefValue;
pub type CMuFCRefValue = CMuGenRefValue;
pub type CMuIBRefValue = CMuGenRefValue;
pub type CMuCString = *mut c_char;
pub type CMuID = u32;
pub type CMuName = CMuCString;
pub type CMuCPtr = *mut c_void;
......
......@@ -130,10 +130,9 @@ impl MuVM {
}
/**
* The client expects a "const char*" (expressed in the muapi.h as "char*", but "const char*"
* should be more appropriate). The client does not know when it should free that string, so
* the micro VM has to immortalise a CString object. In this example, the Rust-level MuVM
* struct holds a `cname_dict` hashmap which owns all CString instances.
* The client expects a "const char*". The client does not know when it should free that
* string, so the micro VM has to immortalise a CString object. In this example, the Rust-level
* MuVM struct holds a `cname_dict` hashmap which owns all CString instances.
*/
pub fn name_of(&mut self, id: MuID) -> CMuCString {
let c_string = self.cname_dict.entry(id).or_insert_with(|| {
......@@ -142,8 +141,6 @@ impl MuVM {
CString::new(rust_string).unwrap()
});
// Indeed the returned string is const, but the C API does not properly express the
// constness. Perhaps the C API can be improved without adding too much complexity.
c_string.as_ptr() as CMuCString
}
......@@ -160,12 +157,12 @@ impl MuVM {
let wpid: u32 = 99;
let mut result: CMuTrapHandlerResult = 0;
let mut new_stack: CMuValue = ptr::null_mut();
let mut new_stack: CMuValue = ptr::null();
let mut values: *mut CMuValue = ptr::null_mut();
let mut nvalues: usize = 0;
let mut freer: Option<CMuValuesFreer> = None;
let mut freerdata: CMuCPtr = ptr::null_mut();
let mut exception: CMuValue = ptr::null_mut();
let mut exception: CMuValue = ptr::null();
trap_handler(ctx, thread, stack, wpid,
&mut result, &mut new_stack, &mut values, &mut nvalues,
......@@ -192,8 +189,8 @@ impl MuVM {
// free memory
unsafe {
Box::from_raw(stack);
Box::from_raw(thread);
Box::from_raw(stack as *mut APIMuValue);
Box::from_raw(thread as *mut APIMuValue);
}
}
......@@ -221,55 +218,55 @@ impl MuCtx {
panic!("Not implemented")
}
pub fn handle_from_sint8(&mut self, num: i8, len: c_int) -> *mut APIMuValue {
pub fn handle_from_sint8(&mut self, num: i8, len: c_int) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn handle_from_uint8(&mut self, num: u8, len: c_int) -> *mut APIMuValue {
pub fn handle_from_uint8(&mut self, num: u8, len: c_int) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn handle_from_sint16(&mut self, num: i16, len: c_int) -> *mut APIMuValue {
pub fn handle_from_sint16(&mut self, num: i16, len: c_int) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn handle_from_uint16(&mut self, num: u16, len: c_int) -> *mut APIMuValue {
pub fn handle_from_uint16(&mut self, num: u16, len: c_int) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn handle_from_sint32(&mut self, num: i32, len: c_int) -> *mut APIMuValue {
pub fn handle_from_sint32(&mut self, num: i32, len: c_int) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn handle_from_uint32(&mut self, num: u32, len: c_int) -> *mut APIMuValue {
pub fn handle_from_uint32(&mut self, num: u32, len: c_int) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn handle_from_sint64(&mut self, num: i64, len: c_int) -> *mut APIMuValue {
pub fn handle_from_sint64(&mut self, num: i64, len: c_int) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn handle_from_uint64(&mut self, num: u64, len: c_int) -> *mut APIMuValue {
pub fn handle_from_uint64(&mut self, num: u64, len: c_int) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn handle_from_uint64s(&mut self, nums: &[u64], len: c_int) -> *mut APIMuValue {
pub fn handle_from_uint64s(&mut self, nums: &[u64], len: c_int) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn handle_from_float(&mut self, num: f32) -> *mut APIMuValue {
pub fn handle_from_float(&mut self, num: f32) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn handle_from_double(&mut self, num: f64) -> *mut APIMuValue {
pub fn handle_from_double(&mut self, num: f64) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn handle_from_ptr(&mut self, mu_type: MuID, ptr: CMuCPtr) -> *mut APIMuValue {
pub fn handle_from_ptr(&mut self, mu_type: MuID, ptr: CMuCPtr) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn handle_from_fp(&mut self, mu_type: MuID, fp: CMuCFP) -> *mut APIMuValue {
pub fn handle_from_fp(&mut self, mu_type: MuID, fp: CMuCFP) -> *const APIMuValue {
panic!("Not implemented")
}
......@@ -321,19 +318,19 @@ impl MuCtx {
panic!("Not implemented")
}
pub fn handle_from_const(&mut self, id: MuID) -> *mut APIMuValue {
pub fn handle_from_const(&mut self, id: MuID) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn handle_from_global(&mut self, id: MuID) -> *mut APIMuValue {
pub fn handle_from_global(&mut self, id: MuID) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn handle_from_func(&mut self, id: MuID) -> *mut APIMuValue {
pub fn handle_from_func(&mut self, id: MuID) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn handle_from_expose(&mut self, id: MuID) -> *mut APIMuValue {
pub fn handle_from_expose(&mut self, id: MuID) -> *const APIMuValue {
panic!("Not implemented")
}
......@@ -349,55 +346,55 @@ impl MuCtx {
panic!("Not implemented")
}
pub fn extract_value(&mut self, str: &APIMuValue, index: c_int) -> *mut APIMuValue {
pub fn extract_value(&mut self, str: &APIMuValue, index: c_int) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn insert_value(&mut self, str: &APIMuValue, index: c_int, newval: &APIMuValue) -> *mut APIMuValue {
pub fn insert_value(&mut self, str: &APIMuValue, index: c_int, newval: &APIMuValue) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn extract_element(&mut self, str: &APIMuValue, index: &APIMuValue) -> *mut APIMuValue {
pub fn extract_element(&mut self, str: &APIMuValue, index: &APIMuValue) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn insert_element(&mut self, str: &APIMuValue, index: &APIMuValue, newval: &APIMuValue) -> *mut APIMuValue {
pub fn insert_element(&mut self, str: &APIMuValue, index: &APIMuValue, newval: &APIMuValue) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn new_fixed(&mut self, mu_type: MuID) -> *mut APIMuValue {
pub fn new_fixed(&mut self, mu_type: MuID) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn new_hybrid(&mut self, mu_type: MuID, length: &APIMuValue) -> *mut APIMuValue {
pub fn new_hybrid(&mut self, mu_type: MuID, length: &APIMuValue) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn refcast(&mut self, opnd: &APIMuValue, new_type: MuID) -> *mut APIMuValue {
pub fn refcast(&mut self, opnd: &APIMuValue, new_type: MuID) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn get_iref(&mut self, opnd: &APIMuValue) -> *mut APIMuValue {
pub fn get_iref(&mut self, opnd: &APIMuValue) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn get_field_iref(&mut self, opnd: &APIMuValue, field: c_int) -> *mut APIMuValue {
pub fn get_field_iref(&mut self, opnd: &APIMuValue, field: c_int) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn get_elem_iref(&mut self, opnd: &APIMuValue, index: &APIMuValue) -> *mut APIMuValue {
pub fn get_elem_iref(&mut self, opnd: &APIMuValue, index: &APIMuValue) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn shift_iref(&mut self, opnd: &APIMuValue, offset: &APIMuValue) -> *mut APIMuValue {
pub fn shift_iref(&mut self, opnd: &APIMuValue, offset: &APIMuValue) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn get_var_part_iref(&mut self, opnd: &APIMuValue) -> *mut APIMuValue {
pub fn get_var_part_iref(&mut self, opnd: &APIMuValue) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn load(&mut self, ord: CMuMemOrd, loc: &APIMuValue) -> *mut APIMuValue {
pub fn load(&mut self, ord: CMuMemOrd, loc: &APIMuValue) -> *const APIMuValue {
panic!("Not implemented")
}
......@@ -405,11 +402,11 @@ impl MuCtx {
panic!("Not implemented")
}
pub fn cmpxchg(&mut self, ord_succ: CMuMemOrd, ord_fail: CMuMemOrd, weak: bool, loc: &APIMuValue, expected: &APIMuValue, desired: &APIMuValue, is_succ: *mut CMuBool) -> *mut APIMuValue {
pub fn cmpxchg(&mut self, ord_succ: CMuMemOrd, ord_fail: CMuMemOrd, weak: bool, loc: &APIMuValue, expected: &APIMuValue, desired: &APIMuValue, is_succ: *mut CMuBool) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn atomicrmw(&mut self, ord: CMuMemOrd, op: CMuAtomicRMWOptr, loc: &APIMuValue, opnd: &APIMuValue) -> *mut APIMuValue {
pub fn atomicrmw(&mut self, ord: CMuMemOrd, op: CMuAtomicRMWOptr, loc: &APIMuValue, opnd: &APIMuValue) -> *const APIMuValue {
panic!("Not implemented")
}
......@@ -417,15 +414,15 @@ impl MuCtx {
panic!("Not implemented")
}
pub fn new_stack(&mut self, func: &APIMuValue) -> *mut APIMuValue {
pub fn new_stack(&mut self, func: &APIMuValue) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn new_thread_nor(&mut self, stack: &APIMuValue, threadlocal: Option<&APIMuValue>, vals: Vec<&APIMuValue>) -> *mut APIMuValue {
pub fn new_thread_nor(&mut self, stack: &APIMuValue, threadlocal: Option<&APIMuValue>, vals: Vec<&APIMuValue>) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn new_thread_exc(&mut self, stack: &APIMuValue, threadlocal: Option<&APIMuValue>, exc: &APIMuValue) -> *mut APIMuValue {
pub fn new_thread_exc(&mut self, stack: &APIMuValue, threadlocal: Option<&APIMuValue>, exc: &APIMuValue) -> *const APIMuValue {
panic!("Not implemented")
}
......@@ -437,11 +434,11 @@ impl MuCtx {
panic!("Not implemented")
}
pub fn get_threadlocal(&mut self, thread: &APIMuValue) -> *mut APIMuValue {
pub fn get_threadlocal(&mut self, thread: &APIMuValue) -> *const APIMuValue {
panic!("Not implemented")
}
pub fn new_cursor(&mut self, stack: &APIMuValue) -> *mut APIMuValue {
pub fn new_cursor(&mut self, stack: &APIMuValue) -> *const APIMuValue {
panic!("Not implemented")
}
......@@ -449,7 +446,7 @@ impl MuCtx {
panic!("Not implemented")
}
pub fn copy_cursor(&mut self, cursor: &APIMuValue) -> *mut APIMuValue {
pub fn copy_cursor(&mut self, cursor: &APIMuValue) -> *const APIMuValue {
panic!("Not implemented")
}
......@@ -493,31 +490,31 @@ impl MuCtx {
panic!("Not implemented")
}
pub fn tr64_to_fp(&mut self, value: &APIMuValue) -> *mut APIMuValue {
pub fn tr64_to_fp(&mut self, value: &APIMuValue) -> *const APIMuValue {
panic!("Not implemented")