[Anthy-dev 2531] Re: ScmObjInternalのCompacting

Back to archive index

Kazuki Ohta mover****@hct*****
2005年 10月 14日 (金) 08:40:29 JST


太田です。おはようございます。

On Friday 14 October 2005 05:25, Jun Inoue wrote:
> この文言では「sweep の最中には s->Y == 0」と読めます。あと > が抜けて
> る。正しくは
> ...marking bit of GC.  The G bit of S->Y denotes the finalization
> semantics.  For a ConsCell, S->Y's G bit is always 0.
> とか、
> ...marking bit of GC.  S->Y's G bit is always set to 0, which helps
> determine the finalization semantics without a pointer. とか。
確かにそう取れますね。言葉を変えておきます。

>即値型に pointer を持たせると leak します。最後に消える参照が stack に
>あったとき、sweep で見つからないので。
あ、なるほど...これは考えに有りませんでした。


On Friday 14 October 2005 07:51, YamaKen wrote:
> 上記の事情を踏まえて以下のようなフォーマットはどうでしょう。
>
>       S        Type
> 0000000|00G : #f      (S = 0)
> .......|00G : Cons
> ------------------------------
> 0000000|01G : ()      (S = 0)
> .......|01G : Closure
> ------------------------------
> 0000000|10G : Unbound (S = 0)
> .......|10G : Others
> ------------------------------
> ......0|11G : Integer (imm)
> ------------------------------
> ......1|11G : Char    (imm)
> ------------------------------
>
> S->Y of Others
>    O           Type                 content of O
> ........|001 : Symbol             : vcell
> ........|011 : String             : string length
> ........|101 : Vector             : vector length
> .....|000111 : Values             : unused, all 0 (for efficiency)
> .....|001111 : Func               : ScmFuncTypeCode
> .....|010111 : Port               : ScmPortDirection
> .....|011111 : Continuation       : unused, all 0
> .....|100111 : C Pointer          : pointer type (0 = void *, 1 =
> ScmFuncType) .....|101111 : Reserved
> .....|110111 : Special Constant   : constant ID
>                                     1 : #t
>                                     2 : EOF
>                                     3 : Undef
> .....|111111 : FreeCell           : unused, all 1 (for efficiency)
おお、かなりすっきりしましたね。FALSEPやNULLP等も速そうでよい感じです。

> ・NULL|tagによく使う定数をエンコード。大抵のアーキテクチャで
>   immediate operandに収まる事を期待。CONSP等にNULLチェックが必要
>   になるけどそこは妥協
たぶん僕の弱いマシン寄りの話だと思うのですが、ここの意味がちと分からないの
で、少し説明して貰えませんか?

-- 
-------------------------------------------------
Kazuki Ohta : mover****@hct*****
-------------------------------------------------



Anthy-dev メーリングリストの案内
Back to archive index