検索

phrase: max: clip:
target: order:
Results of 1 - 2 of about 2 for ref (0.006 sec.)
リーク 11228
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... { ptr: *mut RcBox<T>, } struct RcBox<T> { data: T, ref_count: usize, } impl<T> Rc<T> { fn new(data: T) -> ... :<RcBox<T>>(); ptr::write(ptr, RcBox { data: data, ref_count: 1, }); Rc { ptr: ptr } } } fn clone(&self) ... -> Self { unsafe { (*self.ptr).ref_count += 1; } Rc { ptr: self.ptr } } } impl<T> Dro ... Rc<T> { fn drop(&mut self) { unsafe { (*self.ptr).ref_count -= 1; if (*self.ptr).ref_count == 0 { // デー ...
https://man.plustar.jp/rust/nomicon/leaking.html - [similar]
例外安全性 7485
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... { self.pos } fn removed(&self) -> &T { self.elt.as_ref().unwrap() } unsafe fn get(&self, index: usize) -> ...
https://man.plustar.jp/rust/nomicon/exception-safety.html - [similar]
PREV 1 NEXT