aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1997-09-01 23:37:14 +0000
committerRichard M. Stallman1997-09-01 23:37:14 +0000
commit1cd5fe6a3a99e1e695d7d58b6dcf06ecc6d19dc2 (patch)
tree3eb8423540679f4be77669c79c4d3b94899c18eb /src
parent35ce8cd7933732811dfcbc2d93f6cc0d5aca6305 (diff)
downloademacs-1cd5fe6a3a99e1e695d7d58b6dcf06ecc6d19dc2.tar.gz
emacs-1cd5fe6a3a99e1e695d7d58b6dcf06ecc6d19dc2.zip
(free_float, free_cons): Don't use the same field for chaining as for marking.
(make_float, Fcons, gc_sweep): Corresponding changes.
Diffstat (limited to 'src')
-rw-r--r--src/alloc.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/alloc.c b/src/alloc.c
index b5a45fd3845..e94e76d3fb2 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -588,7 +588,7 @@ init_float ()
588free_float (ptr) 588free_float (ptr)
589 struct Lisp_Float *ptr; 589 struct Lisp_Float *ptr;
590{ 590{
591 *(struct Lisp_Float **)&ptr->type = float_free_list; 591 *(struct Lisp_Float **)&ptr->data = float_free_list;
592 float_free_list = ptr; 592 float_free_list = ptr;
593} 593}
594 594
@@ -600,8 +600,10 @@ make_float (float_value)
600 600
601 if (float_free_list) 601 if (float_free_list)
602 { 602 {
603 /* We use the data field for chaining the free list
604 so that we won't use the same field that has the mark bit. */
603 XSETFLOAT (val, float_free_list); 605 XSETFLOAT (val, float_free_list);
604 float_free_list = *(struct Lisp_Float **)&float_free_list->type; 606 float_free_list = *(struct Lisp_Float **)&float_free_list->data;
605 } 607 }
606 else 608 else
607 { 609 {
@@ -668,7 +670,7 @@ init_cons ()
668free_cons (ptr) 670free_cons (ptr)
669 struct Lisp_Cons *ptr; 671 struct Lisp_Cons *ptr;
670{ 672{
671 *(struct Lisp_Cons **)&ptr->car = cons_free_list; 673 *(struct Lisp_Cons **)&ptr->cdr = cons_free_list;
672 cons_free_list = ptr; 674 cons_free_list = ptr;
673} 675}
674 676
@@ -681,8 +683,10 @@ DEFUN ("cons", Fcons, Scons, 2, 2, 0,
681 683
682 if (cons_free_list) 684 if (cons_free_list)
683 { 685 {
686 /* We use the cdr for chaining the free list
687 so that we won't use the same field that has the mark bit. */
684 XSETCONS (val, cons_free_list); 688 XSETCONS (val, cons_free_list);
685 cons_free_list = *(struct Lisp_Cons **)&cons_free_list->car; 689 cons_free_list = *(struct Lisp_Cons **)&cons_free_list->cdr;
686 } 690 }
687 else 691 else
688 { 692 {
@@ -2134,7 +2138,7 @@ gc_sweep ()
2134 if (!XMARKBIT (cblk->conses[i].car)) 2138 if (!XMARKBIT (cblk->conses[i].car))
2135 { 2139 {
2136 num_free++; 2140 num_free++;
2137 *(struct Lisp_Cons **)&cblk->conses[i].car = cons_free_list; 2141 *(struct Lisp_Cons **)&cblk->conses[i].cdr = cons_free_list;
2138 cons_free_list = &cblk->conses[i]; 2142 cons_free_list = &cblk->conses[i];
2139 } 2143 }
2140 else 2144 else
@@ -2164,7 +2168,7 @@ gc_sweep ()
2164 if (!XMARKBIT (fblk->floats[i].type)) 2168 if (!XMARKBIT (fblk->floats[i].type))
2165 { 2169 {
2166 num_free++; 2170 num_free++;
2167 *(struct Lisp_Float **)&fblk->floats[i].type = float_free_list; 2171 *(struct Lisp_Float **)&fblk->floats[i].data = float_free_list;
2168 float_free_list = &fblk->floats[i]; 2172 float_free_list = &fblk->floats[i];
2169 } 2173 }
2170 else 2174 else