2021-02-21から1日間の記事一覧

循環参照 - Rc<T>とRefCell<T>

循環参照はメモリーをリークする Rustのメモリ安全保障において、メモリーリークを発生させることはとてつもなく難しい。 Preventing memory leaks entirely is not one of Rust's guarantees in the same way that disallowing data race at compile time i…

スマートポインタ Rc<T> - 参照カウンタ

Rc<T>, the Reference Counted Smart Pointer 所有権は多くの場合において明白である。つまり「1変数は、1つの値の所有する 」。 しかしながら 一つの値が複数の所有者を持つ ケースが存在する。 例として、グラフ構造がある。 グラフは、複数の辺が同一のノ</t>…