検索

phrase: max: clip:
target: order:
Results of 1 - 10 of about 53 for Unsafe (0.029 sec.)
安全と危険の相互作用 13425
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... いるのでしょうか? どのように影響し合うのでしょうか? unsafe キーワードがインターフェースとなり、安全な Rust と ... に境界外に管理されている、と言うことができるのです。 unsafe は 2 つの目的に使われます。コンパイラがチェックでき ... トレイトの宣言 に未チェックな契約が存在する事を、 unsafe を使って示すことができます。 関数に unsafe を使うと ... ユーザーに要請することになります。 トレイトの宣言に unsafe を使うと、そのトレイトを実装するユーザーに対し、ド ...
https://man.plustar.jp/rust/nomicon/safe-unsafe-meaning.html - [similar]
Final Code 12130
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... p: usize, } impl<T> RawVec<T> { fn new() -> Self { unsafe { // !0 is usize::MAX. This branch should be strip ... TY as *mut T), cap: cap } } } fn grow(&mut self) { unsafe { let elem_size = mem::size_of::<T>(); // since we ... n_of::<T>(); let num_bytes = elem_size * self.cap; unsafe { heap::deallocate(*self.ptr as *mut _, num_bytes, ... ) { if self.len == self.cap() { self.buf.grow(); } unsafe { ptr::write(self.ptr().offset(self.len as isize), ...
https://man.plustar.jp/rust/nomicon/vec-final.html - [similar]
Send and Sync 11654
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... make them work right. First and foremost, they're unsafe traits . This means that they are unsafe to implem ... ent, and other unsafe code can assume that they are correctly implemente ... end nor Sync (because they have no safety guards). UnsafeCell isn't Sync (and therefore Cell and RefCell are ... the refcount is shared and unsynchronized). Rc and UnsafeCell are very fundamentally not thread-safe: they e ...
https://man.plustar.jp/rust/nomicon/send-and-sync.html - [similar]
print.html 9793
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... 事は、たったこれだけです。 生ポインタが指す値を得る unsafe な関数を呼ぶ(C 言語で書かれた関数や、intrinsic、生 ... のアロケータなど) unsafe なトレイトを実装する 静的な構造体を変更する これだ ... いるのでしょうか? どのように影響し合うのでしょうか? unsafe キーワードがインターフェースとなり、安全な Rust と ... に境界外に管理されている、と言うことができるのです。 unsafe は 2 つの目的に使われます。コンパイラがチェックでき ...
https://man.plustar.jp/rust/nomicon/print.html - [similar]
Unsafe と連携する 9793
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... と Mutex の実装 Light (default) Rust Coal Navy Ayu Unsafe と連携する たいていの場合、アンセーフな Rust を扱う ... , arr: &[u8]) -> Option<u8> { if idx < arr.len() { unsafe { Some(*arr.get_unchecked(idx)) } } else { None } ... クス参照します。 しかしこのような自明な関数でさえも、unsafe ブロックのスコープには疑問が残ります。 < を <= に変 ... arr: &[u8]) -> Option<u8> { if idx <= arr.len() { unsafe { Some(*arr.get_unchecked(idx)) } } else { None } ...
https://man.plustar.jp/rust/nomicon/working-with-unsafe.html - [similar]
サイズが 0 の型を扱う 8811
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... 意味します。 impl<T> RawVec<T> { fn new() -> Self { unsafe { // !0 は usize::MAX です。この分岐はコンパイル時 ... TY as *mut T), cap: cap } } } fn grow(&mut self) { unsafe { let elem_size = mem::size_of::<T>(); // elem_siz ... n_of::<T>(); let num_bytes = elem_size * self.cap; unsafe { heap::deallocate(*self.ptr as *mut _, num_bytes, ... 後に元に戻すという方法です。 impl<T> RawValIter<T> { unsafe fn new(slice: &[T]) -> Self { RawValIter { start: ...
https://man.plustar.jp/rust/nomicon/vec-zsts.html - [similar]
RawVec 8498
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... ze_of::<T>() != 0, "TODO: implement ZST support"); unsafe { RawVec { ptr: Unique::new(heap::EMPTY as *mut T) ... } // Vec の時と変更ありません fn grow(&mut self) { unsafe { let align = mem::align_of::<T>(); let elem_size ... e_of::<T>(); let num_bytes = elem_size * self.cap; unsafe { heap::deallocate(*self.ptr as *mut _, num_bytes, ... > Vec<T> { pub fn into_iter(self) -> IntoIter<T> { unsafe { // buf をアンセーフに移動させるため、 ptr:read を ...
https://man.plustar.jp/rust/nomicon/vec-raw.html - [similar]
デストラクタ 8409
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... > } impl<T> Drop for Box<T> { fn drop(&mut self) { unsafe { drop_in_place(*self.ptr); heap::deallocate((*sel ... > } impl<T> Drop for Box<T> { fn drop(&mut self) { unsafe { drop_in_place(*self.ptr); heap::deallocate((*sel ... mpl<T> Drop for SuperBox<T> { fn drop(&mut self) { unsafe { // 超最適化: Box の内容を `drop` せずに // 内容を ... > } impl<T> Drop for Box<T> { fn drop(&mut self) { unsafe { drop_in_place(*self.ptr); heap::deallocate((*sel ...
https://man.plustar.jp/rust/nomicon/destructors.html - [similar]
Drop Check 8335
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... he number of cases where sound code is rejected as unsafe. This would help address cases such as the two Ins ... an unstable attribute that one can use to assert (unsafely) that a generic type's destructor is guaranteed ... write: struct Inspector<'a>(&'a u8, &'static str); unsafe impl<#[may_dangle] 'a> Drop for Inspector<'a> { fn ... this attribute requires the Drop impl to be marked unsafe because the compiler is not checking the implicit ...
https://man.plustar.jp/rust/nomicon/dropck.html - [similar]
例外安全性 8335
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... elf, to_push: &[T]) { self.reserve(to_push.len()); unsafe { // 今さっき reserve をしたので、オーバーフローす ... { fn new(data: &'a mut [T], pos: usize) -> Self { unsafe { let elt = ptr::read(&data[pos]); Hole { data: da ... emoved(&self) -> &T { self.elt.as_ref().unwrap() } unsafe fn get(&self, index: usize) -> &T { &self.data[ind ... ex] } unsafe fn move_to(&mut self, index: usize) { let index_pt ...
https://man.plustar.jp/rust/nomicon/exception-safety.html - [similar]
PREV 1 2 3 4 5 6 NEXT