/commonlibrary/rust/ylong_json/tests/ |
H A D | sdv_adapter_test.rs | 16 use std::ptr::*; 47 let mut ptr: c_double = 0f64; variables 49 ylong_json_get_double_value_from_number(width, &mut ptr as *mut c_double), 52 assert_eq!(ptr, 800f64); 57 let mut ptr: c_double = 0f64; variables 59 ylong_json_get_double_value_from_number(height, &mut ptr as *mut c_double), 62 assert_eq!(ptr, 600f64); 67 let mut ptr: *mut c_char = null_mut::<c_char>(); variables 69 ylong_json_get_value_from_string(title, &mut ptr as *mut *mut c_char), 73 CStr::from_ptr(ptr) 85 let mut ptr: *mut c_char = null_mut::<c_char>(); global() variables 98 let mut ptr: c_double = 0f64; global() variables 108 let mut ptr: c_double = 0f64; global() variables 118 let mut ptr: c_int = 0; global() variables 132 let mut ptr = 0f64; global() variables 140 let mut ptr = 0f64; global() variables 148 let mut ptr = 0f64; global() variables 156 let mut ptr = 0f64; global() variables [all...] |
/commonlibrary/rust/ylong_runtime/ylong_runtime/src/task/ |
H A D | waker.rs | 18 use std::ptr::NonNull; 23 unsafe fn get_header_by_raw_ptr(ptr: *const ()) -> NonNull<Header> { in get_header_by_raw_ptr() 24 let header = ptr as *mut Header; in get_header_by_raw_ptr() 33 unsafe fn clone<T>(ptr: *const ()) -> RawWaker in clone() 37 let header = ptr.cast::<Header>(); in clone() 42 unsafe fn wake(ptr: *const ()) { in wake() 43 let header = get_header_by_raw_ptr(ptr); in wake() 48 unsafe fn wake_by_ref(ptr: *const ()) { in wake_by_ref() 49 let header = get_header_by_raw_ptr(ptr); in wake_by_ref() 54 unsafe fn drop(ptr [all...] |
H A D | raw.rs | 18 use std::ptr::{addr_of_mut, NonNull}; 104 unsafe fn node(mut ptr: NonNull<Self>) -> NonNull<Node<Self>> in node() 108 let node_ptr = addr_of_mut!(ptr.as_mut().node); in node() 115 pub(crate) ptr: NonNull<Header>, 120 unsafe { self.ptr.as_ref() } 125 unsafe { (vir_table.run)(self.ptr) } 130 (vir_table.get_result)(self.ptr, res); 135 (vir_table.cancel)(self.ptr) 140 (vir_table.set_waker)(self.ptr, cur_state, waker) 146 (vir_table.drop_ref)(self.ptr); [all...] |
H A D | mod.rs | 25 use std::ptr::NonNull; 87 self.0.ptr 91 pub(crate) unsafe fn from_raw(ptr: NonNull<Header>) -> Task { 92 Task(RawTask::form_raw(ptr)) 124 let ptr = Box::into_raw(TaskMngInfo::<T, S>::new( 130 let non_ptr = NonNull::new(ptr.cast::<Header>()); 131 let ptr = if let Some(ptr) = non_ptr { 132 ptr 136 RawTask { ptr } [all...] |
/commonlibrary/memory_utils/libdmabufheap/test/unittest/libdmabufheap/ |
H A D | dmabuf_alloc_test.cpp | 62 struct dirent *ptr; in SetUp() local 63 while ((ptr = readdir(dir)) != nullptr) { in SetUp() 64 std::string fileName = ptr->d_name; in SetUp() 95 void *ptr = mmap(NULL, BUFFER_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, buffer.fd, 0); in HWTEST_F() local 96 ASSERT_TRUE(ptr != NULL); in HWTEST_F() 100 ASSERT_GE(sprintf_s((char *)ptr, BUFFER_SIZE, "libdmabufheap"), 0); in HWTEST_F() 104 ASSERT_STREQ("libdmabufheap", (char *)ptr); in HWTEST_F() 106 ASSERT_EQ(0, munmap(ptr, BUFFER_SIZE)); in HWTEST_F() 123 void *ptr = mmap(NULL, BUFFER_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, buffer.fd, 0); in HWTEST_F() local 124 ASSERT_TRUE(ptr ! in HWTEST_F() 208 void *ptr = mmap(NULL, BUFFER_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, buffer.fd, 0); HWTEST_F() local 234 void *ptr = mmap(NULL, BUFFER_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, buffer.fd, 0); HWTEST_F() local 258 void *ptr = mmap(NULL, BUFFER_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, buffer.fd, 0); HWTEST_F() local 290 void *ptr = mmap(NULL, BUFFER_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, buffer.fd, 0); HWTEST_F() local [all...] |
/commonlibrary/rust/ylong_http/ylong_http_client/src/util/c_openssl/ssl/ |
H A D | ctx.rs | 14 use core::{fmt, mem, ptr}; 97 let ptr = check_ptr(unsafe { SSL_CTX_new(method.as_ptr()) })?; 98 check_ret(unsafe { SSL_CTX_set_default_verify_paths(ptr) })?; 100 let mut builder = Self::from_ptr(ptr); 111 pub(crate) fn from_ptr(ptr: *mut SSL_CTX) -> Self { 112 SslContextBuilder(SslContext(ptr)) 126 let ptr = self.as_ptr_mut(); 131 ptr, 134 ptr::null_mut(), 141 unsafe { SSL_CTX_set_min_proto_version(ptr, versio [all...] |
H A D | ssl_base.rs | 18 use std::ptr::null; 54 let ptr = check_ptr(SSL_new(ctx.as_ptr()))?; 55 Ok(Ssl::from_ptr(ptr)) 103 let ptr = SSL_state_string_long(self.as_ptr()); in ssl_status() 104 ffi::CStr::from_ptr(ptr as *const _) in ssl_status()
|
/commonlibrary/rust/ylong_http/ylong_http_client/src/util/c_openssl/ |
H A D | mod.rs | 34 use core::ptr; 50 pub(crate) fn check_ptr<T>(ptr: *mut T) -> Result<*mut T, ErrorStack> { 51 if ptr.is_null() { 54 Ok(ptr) 73 OPENSSL_init_ssl(init_options, ptr::null_mut());
|
H A D | x509.rs | 14 use core::{ffi, fmt, ptr, str}; 68 let ptr = check_ptr(unsafe { 69 PEM_read_bio_X509(bio.as_ptr(), ptr::null_mut(), None, ptr::null_mut()) 71 Ok(X509::from_ptr(ptr)) 78 let ptr = check_ptr(unsafe { d2i_X509(ptr::null_mut(), &mut der.as_ptr(), len) })?; 79 Ok(X509::from_ptr(ptr)) 90 let r = PEM_read_bio_X509(bio.as_ptr(), ptr::null_mut(), None, ptr [all...] |
H A D | foreign.rs | 25 fn from_ptr(ptr: *mut Self::CStruct) -> Self; in from_ptr() 37 unsafe fn from_ptr<'a>(ptr: *mut Self::CStruct) -> &'a Self { in from_ptr() 38 &*(ptr as *mut _) in from_ptr() 44 unsafe fn from_ptr_mut<'a>(ptr: *mut Self::CStruct) -> &'a mut Self { in from_ptr_mut() 45 &mut *(ptr as *mut _) in from_ptr_mut() 75 fn from_ptr(ptr: *mut $ctype) -> $owned { in from_ptr() 76 $owned(ptr) in from_ptr()
|
H A D | bio.rs | 17 use core::{ptr, slice}; 86 let ptr = check_ptr(BIO_meth_new(BIO_TYPE_NONE, b"rust\0".as_ptr() as *const _))?; in new() 87 let bio_method = BioMethodInner(ptr); in new() 89 BIO_meth_set_write(ptr, bwrite::<S>); in new() 90 BIO_meth_set_read(ptr, bread::<S>); in new() 91 BIO_meth_set_puts(ptr, bputs::<S>); in new() 92 BIO_meth_set_ctrl(ptr, ctrl::<S>); in new() 93 BIO_meth_set_create(ptr, create); in new() 94 BIO_meth_set_destroy(ptr, destroy::<S>); in new() 217 BIO_set_data(bio, ptr [all...] |
/commonlibrary/rust/ylong_runtime/ylong_runtime/src/executor/ |
H A D | block_on.rs | 23 fn clone(ptr: *const ()) -> RawWaker { in clone() 24 let thread = unsafe { Arc::from_raw(ptr.cast::<Parker>()) }; in clone() 33 fn wake(ptr: *const ()) { in wake() 34 let thread = unsafe { Arc::from_raw(ptr.cast::<Parker>()) }; in wake() 38 fn wake_by_ref(ptr: *const ()) { in wake_by_ref() 39 let thread = unsafe { Arc::from_raw(ptr.cast::<Parker>()) }; in wake_by_ref() 44 fn drop(ptr: *const ()) { in drop() 45 unsafe { mem::drop(Arc::from_raw(ptr.cast::<Parker>())) }; in drop()
|
H A D | queue.rs | 21 use std::{cmp, ptr}; 30 ptr::read((data as *const AtomicU16).cast::<u16>()) in non_atomic_load() 234 Some(unsafe { ptr::read(task).assume_init() }) 278 let ptr = self.buffer[idx].get(); 280 ptr::write((*ptr).as_mut_ptr(), task); 322 let task = unsafe { ptr::read(task_ptr).assume_init() }; 324 ptr::write((*dst_ptr.get()).as_mut_ptr(), task); 391 let task = unsafe { ptr::read(task_ptr).assume_init() }; 392 let ptr [all...] |
H A D | worker.rs | 15 use std::ptr; 27 pub(crate) static CURRENT_WORKER: Cell<* const ()> = Cell::new(ptr::null()); 28 pub(crate) static CURRENT_HANDLE: Cell<* const ()> = Cell::new(ptr::null()); 205 /// Gets Worker's Inner with ptr. 209 /// always hold the borrow_mut until drop. So we can only get Inner by ptr. 213 let ptr = self.inner.as_ptr(); 214 &*ptr
|
H A D | current_thread.rs | 211 fn clone(ptr: *const ()) -> RawWaker { in clone() 212 let parker = unsafe { Arc::from_raw(ptr.cast::<Parker>()) }; in clone() 221 fn wake(ptr: *const ()) { in wake() 222 let parker = unsafe { Arc::from_raw(ptr.cast::<Parker>()) }; in wake() 226 fn wake_by_ref(ptr: *const ()) { in wake_by_ref() 227 let parker = unsafe { Arc::from_raw(ptr.cast::<Parker>()) }; in wake_by_ref() 232 fn drop(ptr: *const ()) { in drop() 233 unsafe { mem::drop(Arc::from_raw(ptr.cast::<Parker>())) }; in drop() 478 ctx.set(std::ptr::null()); in ut_current_thread_run_queue()
|
/commonlibrary/rust/ylong_runtime/ylong_runtime/src/sync/mpsc/unbounded/ |
H A D | queue.rs | 16 use std::ptr; 17 use std::ptr::NonNull; 48 next: AtomicPtr::new(ptr::null_mut()), in new() 53 self.next.store(ptr::null_mut(), Release); in reclaim() 56 fn try_insert(&self, ptr: *mut Block<T>) -> Result<(), *mut Block<T>> { in try_insert() 59 .compare_exchange(ptr::null_mut(), ptr, AcqRel, Acquire) in try_insert() 66 fn insert(&self, ptr: *mut Block<T>) { in insert() 73 match curr.try_insert(ptr) { in insert() 77 // therefore this next ptr i in insert() [all...] |
/commonlibrary/c_utils/base/src/ |
H A D | timer.cpp | 188 for (const TimerEntryPtr& ptr : entryList) { in OnTimer() 189 if (ptr->timerFd != timerFd) { in OnTimer() 194 ptr->callback(); in OnTimer() 197 if (!ptr->once) { in OnTimer() 200 onceIdsUnused.push_back(ptr->timerId); in OnTimer() 231 for (const TimerEntryPtr &ptr : entryList) { in GetTimerFd() 232 if (!ptr->once) { in GetTimerFd() 233 return ptr->timerFd; in GetTimerFd()
|
H A D | directory_ex.cpp | 166 dirent *ptr = readdir(topNode); in GetDirFiles() local 167 if (ptr == nullptr) { in GetDirFiles() 177 string name = ptr->d_name; in GetDirFiles() 181 if (ptr->d_type == DT_DIR) { in GetDirFiles() 258 struct dirent *ptr = readdir(currentDir); in ForceRemoveDirectory() local 259 if (ptr == nullptr) { in ForceRemoveDirectory() 262 const char *name = ptr->d_name; in ForceRemoveDirectory() 268 if (ptr->d_type == DT_DIR) { in ForceRemoveDirectory() 383 struct dirent *ptr = readdir(dir); in ChangeModeDirectory() local 384 if (ptr in ChangeModeDirectory() [all...] |
/commonlibrary/rust/ylong_json/src/value/object/ |
H A D | linked_list.rs | 16 use core::ptr::null; 248 let mut ptr = null(); variables 252 ptr = cursor.current_node_ptr(); 258 if ptr.is_null() { 263 &mut (*(ptr as *mut Node<(String, JsonValue)>))
|
/commonlibrary/rust/ylong_runtime/ylong_runtime/src/ffrt/ |
H A D | ffrt_timer.rs | 33 let ptr = ylong_ffrt::ffrt_timer_start(dur, data, timer_wake_hook); 35 FfrtTimerEntry(ptr)
|
/commonlibrary/rust/ylong_runtime/ylong_io/src/sys/unix/ |
H A D | socket_addr.rs | 27 let ptr: *const SocketAddrLibC = self; 28 ptr.cast::<sockaddr>()
|
H A D | kqueue.rs | 18 use std::{cmp, io, mem, ptr}; 58 None => ptr::null_mut(), in select() 63 ptr::null(), in select() 163 syscall!(kevent(self.kq, &event, 1, &mut event, 1, ptr::null())).map(|_| { in kevent_notify() 181 ptr::null(), in kevent_register()
|
/commonlibrary/rust/ylong_runtime/ylong_runtime/src/util/ |
H A D | linked_list.rs | 23 use std::ptr::NonNull; 77 unsafe fn node(ptr: NonNull<Self>) -> NonNull<Node<Self>> in node() 178 use std::ptr::{addr_of_mut, NonNull}; 201 unsafe fn address_of_node(mut ptr: NonNull<Entry>) -> NonNull<Node<Entry>> { in address_of_node() 202 let node_ptr = addr_of_mut!(ptr.as_mut().node); in address_of_node() 206 fn get_val(ptr: NonNull<Entry>) -> usize { in get_val() 207 unsafe { ptr.as_ref().val } in get_val() 211 unsafe fn node(ptr: NonNull<Self>) -> NonNull<Node<Self>> { in node() 212 address_of_node(ptr) in node()
|
/commonlibrary/rust/ylong_runtime/ylong_ffrt/src/ |
H A D | task.rs | 80 let ptr = self as *mut FfrtTaskAttr; in set_qos() 81 ffrt_task_attr_set_qos(ptr, qos); in set_qos()
|
/commonlibrary/utils_lite/memory/include/ |
H A D | ohos_mem_pool.h | 90 * @param ptr identify the memory blocks that need to be released.
96 void OhosFree(void *ptr);
|