/[emacs]/emacs/src/alloc.c
ViewVC logotype

Diff of /emacs/src/alloc.c

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

revision 1.382 by kfstorm, Wed Nov 9 23:14:12 2005 UTC revision 1.383 by schwab, Tue Nov 15 13:53:26 2005 UTC
# Line 2531  void Line 2531  void
2531  free_float (ptr)  free_float (ptr)
2532       struct Lisp_Float *ptr;       struct Lisp_Float *ptr;
2533  {  {
2534    *(struct Lisp_Float **)&ptr->data = float_free_list;    ptr->u.chain = float_free_list;
2535    float_free_list = ptr;    float_free_list = ptr;
2536  }  }
2537    
# Line 2549  make_float (float_value) Line 2549  make_float (float_value)
2549        /* We use the data field for chaining the free list        /* We use the data field for chaining the free list
2550           so that we won't use the same field that has the mark bit.  */           so that we won't use the same field that has the mark bit.  */
2551        XSETFLOAT (val, float_free_list);        XSETFLOAT (val, float_free_list);
2552        float_free_list = *(struct Lisp_Float **)&float_free_list->data;        float_free_list = float_free_list->u.chain;
2553      }      }
2554    else    else
2555      {      {
# Line 2649  void Line 2649  void
2649  free_cons (ptr)  free_cons (ptr)
2650       struct Lisp_Cons *ptr;       struct Lisp_Cons *ptr;
2651  {  {
2652    *(struct Lisp_Cons **)&ptr->cdr = cons_free_list;    ptr->u.chain = cons_free_list;
2653  #if GC_MARK_STACK  #if GC_MARK_STACK
2654    ptr->car = Vdead;    ptr->car = Vdead;
2655  #endif  #endif
# Line 2668  DEFUN ("cons", Fcons, Scons, 2, 2, 0, Line 2668  DEFUN ("cons", Fcons, Scons, 2, 2, 0,
2668        /* We use the cdr for chaining the free list        /* We use the cdr for chaining the free list
2669           so that we won't use the same field that has the mark bit.  */           so that we won't use the same field that has the mark bit.  */
2670        XSETCONS (val, cons_free_list);        XSETCONS (val, cons_free_list);
2671        cons_free_list = *(struct Lisp_Cons **)&cons_free_list->cdr;        cons_free_list = cons_free_list->u.chain;
2672      }      }
2673    else    else
2674      {      {
# Line 2703  check_cons_list () Line 2703  check_cons_list ()
2703    struct Lisp_Cons *tail = cons_free_list;    struct Lisp_Cons *tail = cons_free_list;
2704    
2705    while (tail)    while (tail)
2706      tail = *(struct Lisp_Cons **)&tail->cdr;      tail = tail->u.chain;
2707  #endif  #endif
2708  }  }
2709    
# Line 3140  Its value and function definition are vo Line 3140  Its value and function definition are vo
3140    if (symbol_free_list)    if (symbol_free_list)
3141      {      {
3142        XSETSYMBOL (val, symbol_free_list);        XSETSYMBOL (val, symbol_free_list);
3143        symbol_free_list = *(struct Lisp_Symbol **)&symbol_free_list->value;        symbol_free_list = symbol_free_list->next;
3144      }      }
3145    else    else
3146      {      {
# Line 5563  mark_object (arg) Line 5563  mark_object (arg)
5563          CHECK_ALLOCATED_AND_LIVE (live_cons_p);          CHECK_ALLOCATED_AND_LIVE (live_cons_p);
5564          CONS_MARK (ptr);          CONS_MARK (ptr);
5565          /* If the cdr is nil, avoid recursion for the car.  */          /* If the cdr is nil, avoid recursion for the car.  */
5566          if (EQ (ptr->cdr, Qnil))          if (EQ (ptr->u.cdr, Qnil))
5567            {            {
5568              obj = ptr->car;              obj = ptr->car;
5569              cdr_count = 0;              cdr_count = 0;
5570              goto loop;              goto loop;
5571            }            }
5572          mark_object (ptr->car);          mark_object (ptr->car);
5573          obj = ptr->cdr;          obj = ptr->u.cdr;
5574          cdr_count++;          cdr_count++;
5575          if (cdr_count == mark_object_loop_halt)          if (cdr_count == mark_object_loop_halt)
5576            abort ();            abort ();
# Line 5717  gc_sweep () Line 5717  gc_sweep ()
5717            if (!CONS_MARKED_P (&cblk->conses[i]))            if (!CONS_MARKED_P (&cblk->conses[i]))
5718              {              {
5719                this_free++;                this_free++;
5720                *(struct Lisp_Cons **)&cblk->conses[i].cdr = cons_free_list;                cblk->conses[i].u.chain = cons_free_list;
5721                cons_free_list = &cblk->conses[i];                cons_free_list = &cblk->conses[i];
5722  #if GC_MARK_STACK  #if GC_MARK_STACK
5723                cons_free_list->car = Vdead;                cons_free_list->car = Vdead;
# Line 5736  gc_sweep () Line 5736  gc_sweep ()
5736            {            {
5737              *cprev = cblk->next;              *cprev = cblk->next;
5738              /* Unhook from the free list.  */              /* Unhook from the free list.  */
5739              cons_free_list = *(struct Lisp_Cons **) &cblk->conses[0].cdr;              cons_free_list = cblk->conses[0].u.chain;
5740              lisp_align_free (cblk);              lisp_align_free (cblk);
5741              n_cons_blocks--;              n_cons_blocks--;
5742            }            }
# Line 5767  gc_sweep () Line 5767  gc_sweep ()
5767            if (!FLOAT_MARKED_P (&fblk->floats[i]))            if (!FLOAT_MARKED_P (&fblk->floats[i]))
5768              {              {
5769                this_free++;                this_free++;
5770                *(struct Lisp_Float **)&fblk->floats[i].data = float_free_list;                fblk->floats[i].u.chain = float_free_list;
5771                float_free_list = &fblk->floats[i];                float_free_list = &fblk->floats[i];
5772              }              }
5773            else            else
# Line 5783  gc_sweep () Line 5783  gc_sweep ()
5783            {            {
5784              *fprev = fblk->next;              *fprev = fblk->next;
5785              /* Unhook from the free list.  */              /* Unhook from the free list.  */
5786              float_free_list = *(struct Lisp_Float **) &fblk->floats[0].data;              float_free_list = fblk->floats[0].u.chain;
5787              lisp_align_free (fblk);              lisp_align_free (fblk);
5788              n_float_blocks--;              n_float_blocks--;
5789            }            }
# Line 5871  gc_sweep () Line 5871  gc_sweep ()
5871    
5872              if (!sym->gcmarkbit && !pure_p)              if (!sym->gcmarkbit && !pure_p)
5873                {                {
5874                  *(struct Lisp_Symbol **) &sym->value = symbol_free_list;                  sym->next = symbol_free_list;
5875                  symbol_free_list = sym;                  symbol_free_list = sym;
5876  #if GC_MARK_STACK  #if GC_MARK_STACK
5877                  symbol_free_list->function = Vdead;                  symbol_free_list->function = Vdead;
# Line 5895  gc_sweep () Line 5895  gc_sweep ()
5895            {            {
5896              *sprev = sblk->next;              *sprev = sblk->next;
5897              /* Unhook from the free list.  */              /* Unhook from the free list.  */
5898              symbol_free_list = *(struct Lisp_Symbol **)&sblk->symbols[0].value;              symbol_free_list = sblk->symbols[0].next;
5899              lisp_free (sblk);              lisp_free (sblk);
5900              n_symbol_blocks--;              n_symbol_blocks--;
5901            }            }

Legend:
Removed from v.1.382  
changed lines
  Added in v.1.383

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26