検索

phrase: max: clip:
target: order:
Results of 1 - 10 of about 18 for use (0.026 sec.)
デストラクタ 13366
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... ture(alloc, heap_api, unique)] extern crate alloc; use std::ptr::{drop_in_place, Unique}; use std::mem; u ... ture(alloc, heap_api, unique)] extern crate alloc; use std::ptr::{drop_in_place, Unique}; use std::mem; u ... 注意してください。 ですから、以下のような #![allow(unused)] fn main() { struct Boxy<T> { data1: Box<T>, dat ... Drop を 実装していなくてもです。 同様に #![allow(unused)] fn main() { enum Link { Next(Box<Link>), None, ...
https://man.plustar.jp/rust/nomicon/destructors.html - [similar]
競合 11564
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... 安全性を侵害することが出来ないのです。例: #![allow(unused)] fn main() { use std::thread; use std::sync::ato ... mic::{AtomicUsize, Ordering}; use std::sync::Arc; let data = vec![1, 2, 3, 4]; // Ar ... ", data[idx.load(Ordering::SeqCst)]); } #![allow(unused)] fn main() { use std::thread; use std::sync::ato ... mic::{AtomicUsize, Ordering}; use std::sync::Arc; let data = vec![1, 2, 3, 4]; let i ...
https://man.plustar.jp/rust/nomicon/races.html - [similar]
Final Code 9763
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... ] #![feature(alloc, heap_api)] extern crate alloc; use std::ptr::{Unique, self}; use std::mem; use std::o ... ps::{Deref, DerefMut}; use std::marker::PhantomData; use alloc::heap; struct ...
https://man.plustar.jp/rust/nomicon/vec-final.html - [similar]
Atomics 9608
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... be able to make these kinds of optimizations, because they can seriously improve performance. On the oth ... gly-ordered hardware may be cheap or even free because they already provide strong guarantees uncondition ... before and after it. A data-race-free program that uses only sequentially consistent atomics and data acc ... y intended to be paired. Their names hint at their use case: they're perfectly suited for acquiring and r ...
https://man.plustar.jp/rust/nomicon/atomics.html - [similar]
Drop Check 9454
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... at the same time as another, right? This is why we used the following desugaring of let statements: let x ... at implements Drop. So why do we care? We care because if the type system isn't careful, it could acciden ... wever The Big Rule is the subtlety that we have focused on this whole section: For a generic type to soun ... this variant will also never access borrowed data: use std::fmt; struct Inspector<T: fmt::Display>(T, &'s ...
https://man.plustar.jp/rust/nomicon/dropck.html - [similar]
レイアウト 9454
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... 上記の最後以外の項は、安定版の Rust で実装可能です。 use std::marker::PhantomData; use std::ops::Deref; use ... の Unique を使うことにします。 #![feature(unique)] use std::ptr::{Unique, self}; pub struct Vec<T> { ptr: ...
https://man.plustar.jp/rust/nomicon/vec-layout.html - [similar]
print.html 9162
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... きます。 このようなコードになるでしょう。 #![allow(unused)] fn main() { use std::cmp::Ordering; unsafe trai ... えば、以下の簡単な関数を見てみましょう。 #![allow(unused)] fn main() { fn index(idx: usize, arr: &[u8]) -> ... が残ります。 < を <= に変えてみましょう。 #![allow(unused)] fn main() { fn index(idx: usize, arr: &[u8]) -> ... 厄介になります。 Vec の簡単な実装を見てみましょう。 use std::ptr; // この定義は不完全であることに注意してく ...
https://man.plustar.jp/rust/nomicon/print.html - [similar]
PhantomData 8098
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... 'a> { ptr: *const T, end: *const T, } However because 'a is unused within the struct's body, it's unboun ... ded . Because of the troubles this has historically caused, unbo ... variance that you want, while also providing other useful such as the information needed by drop check. I ... exactly what we tell the PhantomData to simulate: use std::marker; struct Iter<'a, T: 'a> { ptr: *const ...
https://man.plustar.jp/rust/nomicon/phantom-data.html - [similar]
参照外し 8098
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... トしたあとは、 これらも同様に扱えるようになります。 use std::ops::Deref; impl<T> Deref for Vec<T> { type T ... , self.len) } } } では DerefMut も実装しましょう。 use std::ops::DerefMut; impl<T> DerefMut for Vec<T> { ...
https://man.plustar.jp/rust/nomicon/vec-deref.html - [similar]
Send and Sync 7944
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... c と Mutex の実装 Light (default) Rust Coal Navy Ayu Send and Sync Not everything obeys inherited mutabil ... on in memory while mutating it. Unless these types use synchronization to manage this access, they are ab ... have. Incorrectly implementing Send or Sync can cause Undefined Behavior. Send and Sync are also automat ... clude: raw pointers are neither Send nor Sync (because they have no safety guards). UnsafeCell isn't Sync ...
https://man.plustar.jp/rust/nomicon/send-and-sync.html - [similar]
PREV 1 2 NEXT