Rustでつくるガーベジコレクタ

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers. →
monochrome
October 20, 2020

 Rustでつくるガーベジコレクタ

shinjuku.rs #12

monochrome

October 20, 2020

Annual Pro sale · Save $30

Have presentations of your own?

Share with private links, password protection, and more control over your work.

Transcript

21 slides
  1. 構成 virtual machine (VM) Rubyコード 抽象構文木 (AST) バイトコード parser codegen

    a = 1 + 2 PUSH_INT 1 PUSH_INT 2 ADD SET_LVAR ‘a’ Add 1 1 1 2 3 Assign 2 LVAR ’a’
  2. Page 0 7 8 15 16 20 23 24 0x4_0000

    20 mark bitmap 0 7 64b x 4032 slot ≒ 256Kb
  3. Garbage collection: Mark local variables method Array local variables method

    Hash K V K V K V K V Object Instance variables Free list
  4. Garbage collection: Sweep local variables method Array local variables method

    Hash K V K V K V K V Object Instance variables Free list
  5. バグりがちな点 var = [o1, o2, o3].each { |x| x.to_s }

    配列オブジェクトをイテレートし、 各要素を関数で処理して戻り値を集め 配列を作って返すRubyスクリプト

More Decks by monochrome

Other Decks in Programming