Reading Gauche/Reading Gauche 0.9/gauche.h/ScmClass

Top / Reading Gauche / Reading Gauche 0.9 / gauche.h / ScmClass




%% gauche.h
typedef struct ScmClassRec ScmClass;
/* See class.c for the description of function pointer members.
   There's a lot of voodoo magic in class structure, so don't touch
   those fields casually.  Also, the order of these fields must be
   reflected to the class definition macros below */
struct ScmClassRec {
   /* We need all class structures be aligned on (at least) 8-byte boundary
      to make our tagging scheme work.  Dynamically allocated objects
      are *always* 8-byte aligned due to Boehm GC's architecture.  However,
      we found that statically allocated class structures can be placed
      4-byte boundary on some 32bit systems if we started ScmClassRec
      with SCM_INSTANCE_HEADER.  The following union is the trick
      to ensure 8-byte alighment on such systems. */ 
   union {
       double align_dummy;
   } classHdr;

8-byte な境界整列に対応するための実装と思われます。

    ScmClassPrintProc     print;
    ScmClassCompareProc   compare;
    ScmClassSerializeProc serialize;
    ScmClassAllocateProc  allocate;
    ScmClass **cpa;             /* class precedence array, NULL terminated */
    int numInstanceSlots;       /* # of instance slots */
    int coreSize;               /* size of core structure; 0 == unknown */
    unsigned int flags;
    ScmObj name;                /* scheme name */
    ScmObj directSupers;        /* list of classes */
    ScmObj cpl;                 /* list of classes */
    ScmObj accessors;           /* alist of slot-name & slot-accessor */
    ScmObj directSlots;         /* alist of slot-name & slot-definition */
    ScmObj slots;               /* alist of slot-name & slot-definition */
    ScmObj directSubclasses;    /* list of direct subclasses */
    ScmObj directMethods;       /* list of methods that has this class in
                                   its specializer */
    ScmObj initargs;            /* saved key-value list for redefinition */
    ScmObj modules;             /* modules where this class is defined */
    ScmObj redefined;           /* if this class is obsoleted by class
                                   redefinition, points to the new class.
                                   if this class is being redefined, points
                                   to a thread that is handling the
                                   redefinition.  (it won't be seen by
                                   Scheme; see class.c)
                                   otherwise #f */
    ScmInternalMutex mutex;     /* to protect from MT hazard */
    ScmInternalCond cv;         /* wait on this while a class being updated */
    void   *data;               /* extra data to do nasty trick */




コメントはありません。 コメント/Reading Gauche/Reading Gauche 0.9/gauche.h/ScmClass?



now: 5


2020-06-30 2020-06-26 2020-06-15 2020-05-27 2020-05-22 2020-05-14 2020-05-12 2020-05-10
2010-02-01 2010-01-31 2010-01-30 2010-01-29 2010-01-16

Counter: 4937, today: 1, yesterday: 0

リロード   新規 編集 凍結 差分 添付 複製 改名   トップ 一覧 検索 最終更新 バックアップ   ヘルプ   最終更新のRSS

Last-modified: 2010-01-30 (土) 23:18:43 (4043d);  Modified by mona
PukiWiki 1.4.6 Copyright © 2001-2005 PukiWiki Developers Team. License is GPL.
Based on "PukiWiki" 1.3 by yu-ji
Powered by PHP 5.2.17
HTML convert time to 0.022 sec.