/[cmucl]/src/lisp/gencgc.c
ViewVC logotype

Diff of /src/lisp/gencgc.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by dtc, Mon Dec 1 16:44:57 1997 UTC revision 1.5 by dtc, Tue Dec 2 02:50:45 1997 UTC
# Line 2748  scav_vector(lispobj *where, lispobj obje Line 2748  scav_vector(lispobj *where, lispobj obje
2748      fprintf(stderr,"* Not hash table pointer? %x\n",where[2]);      fprintf(stderr,"* Not hash table pointer? %x\n",where[2]);
2749      return 3;      return 3;
2750    }    }
2751    hash_table = PTR(where[2]);    hash_table = (lispobj *)PTR(where[2]);
2752    /* fprintf(stderr,"* hash_table = %x\n", hash_table);*/    /* fprintf(stderr,"* hash_table = %x\n", hash_table);*/
2753    if (!(TypeOf(hash_table[0]) == type_InstanceHeader)) {    if (!(TypeOf(hash_table[0]) == type_InstanceHeader)) {
2754      fprintf(stderr,"* Hash table not instance? %x\n",hash_table[0]);      fprintf(stderr,"* Hash table not instance? %x\n",hash_table[0]);
# Line 2774  scav_vector(lispobj *where, lispobj obje Line 2774  scav_vector(lispobj *where, lispobj obje
2774    scavenge(hash_table,16);    scavenge(hash_table,16);
2775    
2776    /* Cross check the kv_vector. */    /* Cross check the kv_vector. */
2777    if (where != PTR(hash_table[9])) {    if (where != (lispobj *)PTR(hash_table[9])) {
2778      fprintf(stderr,"* hash_table table!=this table? %x\n",hash_table[9]);      fprintf(stderr,"* hash_table table!=this table? %x\n",hash_table[9]);
2779      return 4;      return 4;
2780    }    }
# Line 3466  void scan_weak_pointers(void) Line 3466  void scan_weak_pointers(void)
3466          CEILING((sizeof(struct weak_pointer) / sizeof(lispobj)), 2)          CEILING((sizeof(struct weak_pointer) / sizeof(lispobj)), 2)
3467    
3468  static int  static int
3469  scav_scavenger_hook(lispobj*where, lispobj object)  scav_scavenger_hook(lispobj *where, lispobj object)
3470  {  {
3471    struct scavenger_hook *scav_hook = (struct scavanger_hook *)where;    struct scavenger_hook *scav_hook = (struct scavenger_hook *)where;
3472    lispobj *old_value = scav_hook->value;    lispobj old_value = scav_hook->value;
3473    
3474    /*  fprintf(stderr,"scav scav_hook %x; value %x\n",where,old_value);*/    /*  fprintf(stderr,"scav scav_hook %x; value %x\n",where,old_value);*/
3475    
3476    /* Scavenge the value */    /* Scavenge the value */
3477    scavenge(where+1, 1);    scavenge(where+1, 1);
3478    
3479    {    if (scav_hook->value != old_value) {
3480      if (scav_hook->value != old_value) {      /* Value object has moved */
3481        /* value object has moved */      /* fprintf(stderr,"   value object moved to %x\n",scav_hook->value);*/
3482        /*      fprintf(stderr,"   value object moved to %x\n",scav_hook->value);*/  
3483        /* Check if this hook is already noted. */
3484        /* Check if this hook is already noted. */      /* fprintf(stderr,"   next=%x sh hooks=%x\n",scav_hook->next,scavenger_hooks); */
3485        /*      fprintf(stderr,"   next=%x sh hooks=%x\n",scav_hook->next,scavenger_hooks);*/      if (scav_hook->next == NULL) {
3486        if (scav_hook->next == NULL) {        /*  fprintf(stderr,"   adding to scavenger_hooks\n");*/
3487            /*      fprintf(stderr,"   adding to scavenger_hooks\n");*/        scav_hook->next = scavenger_hooks;
3488            scav_hook->next = scavenger_hooks;        scavenger_hooks = (int)where | type_OtherPointer;
           scavenger_hooks = (int)where | type_OtherPointer;  
         }  
3489      }      }
3490    }    }
3491    
# Line 5495  collect_garbage(unsigned last_gen) Line 5493  collect_garbage(unsigned last_gen)
5493    /* Call the scavenger hook functions */    /* Call the scavenger hook functions */
5494    {    {
5495      struct scavenger_hook *sh;      struct scavenger_hook *sh;
5496      for (sh = PTR((int)scavenger_hooks); sh != PTR(NIL);) {      for (sh = (struct scavenger_hook *)PTR((int)scavenger_hooks);
5497        struct scavenger_hook *sh_next = PTR((int)sh->next);           sh != (struct scavenger_hook *)PTR(NIL);) {
5498          struct scavenger_hook *sh_next = (struct scavenger_hook *)PTR((int)sh->next);
5499        /* fprintf(stderr,"Scav hook %x; next %x; calling scav hook fn %x\n",        /* fprintf(stderr,"Scav hook %x; next %x; calling scav hook fn %x\n",
5500                sh,sh_next,sh->function);*/                sh,sh_next,sh->function);*/
5501        funcall0(sh->function);        funcall0(sh->function);

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

  ViewVC Help
Powered by ViewVC 1.1.5