検索

phrase: max: clip:
target: order:
Results of 1 - 5 of about 5 for count (0.013 sec.)
リーク 12648
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... r: *mut RcBox<T>, } struct RcBox<T> { data: T, ref_count: usize, } impl<T> Rc<T> { fn new(data: T) -> Self ... Box<T>>(); ptr::write(ptr, RcBox { data: data, ref_count: 1, }); Rc { ptr: ptr } } } fn clone(&self) -> Sel ... f { unsafe { (*self.ptr).ref_count += 1; } Rc { ptr: self.ptr } } } impl<T> Drop for ... 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]
チェックされないメモリ 9063
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... レスに受け取った値を 移します。 ptr::copy(src, dest, count) は、 T 型の count が占有するビット数だけ、 src か ... 意してください!) ptr::copy_nonoverlapping(src, dest, count) は copy と同じことをしますが、 2 つのメモリ領域が ...
https://man.plustar.jp/rust/nomicon/unchecked-uninit.html - [similar]
repr(Rust) 8916
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... 。 #![allow(unused)] fn main() { struct Foo<T, U> { count: u16, data1: T, data2: U, } } さて、単体化した Foo ... な型を生成すると思われます。 struct Foo<u16, u32> { count: u16, data1: u16, data2: u32, } struct Foo<u32, u1 ... 6> { count: u16, _pad1: u16, data1: u32, data2: u16, _pad2: u ...
https://man.plustar.jp/rust/nomicon/repr-rust.html - [similar]
print.html 7868
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... 。 #![allow(unused)] fn main() { struct Foo<T, U> { count: u16, data1: T, data2: U, } } さて、単体化した Foo ... な型を生成すると思われます。 struct Foo<u16, u32> { count: u16, data1: u16, data2: u32, } struct Foo<u32, u1 ... 6> { count: u16, _pad1: u16, data1: u32, data2: u16, _pad2: u ... レスに受け取った値を 移します。 ptr::copy(src, dest, count) は、 T 型の count が占有するビット数だけ、 src か ...
https://man.plustar.jp/rust/nomicon/print.html - [similar]
Atomics 7427
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... d operations are still atomic. That is, they don't count as data accesses and any read-modify-write operati ... otherwise care about. For instance, incrementing a counter can be safely done by multiple threads using a r ... elaxed fetch_add if you're not using the counter to synchronize any other accesses. There's rarel ...
https://man.plustar.jp/rust/nomicon/atomics.html - [similar]
PREV 1 NEXT