タグ

2022年12月22日のブックマーク (4件)

  • ヒープ割り当て | Writing an OS in Rust

    この記事は翻訳されたものです: この記事はHeap Allocationをコミュニティの手により翻訳したものです。そのため、翻訳が完全・最新でなかったり、原文にない誤りを含んでいる可能性があります。問題があればこのissue上で報告してください! 翻訳者: @swnakamura 及び @garasubo. この記事では、私たちのカーネルにヒープ割り当て (アロケーション) の機能を追加します。まず動的メモリの基礎を説明し、どのようにして借用チェッカがありがちなアロケーションエラーを防いでくれるのかを示します。その後Rustの基的なアロケーションインターフェースを実装し、ヒープメモリ領域を作成し、アロケータクレートを設定します。この記事を終える頃には、Rustに組み込みのallocクレートのすべてのアロケーション・コレクション型が私たちのカーネルで利用可能になっているでしょう。 このブロ

    masterq
    masterq 2022/12/22
    GlobalAllocトレイトの仕組みがわかりやすい。が "ほとんどの仕事はlinked_list_allocatorクレートに任せてしまっています" 。GlobalAllocトレイトを使うかぎりはallocに失敗するケースを扱えないようだ
  • Heap Allocations - The Rust Performance Book

    Heap Allocations Heap allocations are moderately expensive. The exact details depend on which allocator is in use, but each allocation (and deallocation) typically involves acquiring a global lock, doing some non-trivial data structure manipulation, and possibly executing a system call. Small allocations are not necessarily cheaper than large allocations. It is worth understanding which Rust data

    masterq
    masterq 2022/12/22
    よくわからないんですが、Boxなどこれらの型がどうやってヒープにallocするかは隠されていて一般的に「ヒープにalloc」する仕組みというのはRust stdでは表面から見えないってことなんです?
  • Valgrind

    To use this tool, you must specify --tool=dhat on the Valgrind command line. DHAT is primarily a tool for examining how programs use their heap allocations. It tracks the allocated blocks, and inspects every memory access to find which block, if any, it is to. It presents, on a program point basis, information about these blocks such as sizes, lifetimes, numbers of reads and writes, and read and w

    masterq
    masterq 2022/12/22
    "DHAT is primarily a tool for examining how programs use their heap allocations."
  • 運動嫌いでも腸内環境を整えるだけでやる気が自然と湧いてくるという研究結果

    「運動は体にいい」ということは分かっていても、なかなかやる気が起きないという経験は誰しもあるはず。Natureに掲載された新しい研究により、腸内の環境を整えるだけで運動への「やる気」が湧いてくる可能性が指摘されました。 A microbiome-dependent gut–brain pathway regulates motivation for exercise | Nature https://doi.org/10.1038/s41586-022-05525-z To Hack Your Motivation to Exercise, You May Just Need to Tweak Your Gut Microbiome https://singularityhub.com/2022/12/20/to-hack-your-motivation-to-exercise-you-m

    運動嫌いでも腸内環境を整えるだけでやる気が自然と湧いてくるという研究結果
    masterq
    masterq 2022/12/22
    "マウスの走る意欲を刺激する唯一の要因がマウスの腸内細菌にあることが判明" 肝心の腸内細菌を増やす方法が書かれていない。。。