X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Falloc.c;h=f10c14b28c4eaa2f1c4eb8b7875cf2db999028ef;hb=3aca7317dd930beecbddba646284279744087e69;hp=92a11a4eceb59ae0d1286ce6f687541047956095;hpb=ee79d61567bd4346611f2386ac601f8aba4c5bf9;p=chise%2Fxemacs-chise.git- diff --git a/src/alloc.c b/src/alloc.c index 92a11a4..f10c14b 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -1195,7 +1195,7 @@ make_vector (size_t length, Lisp_Object init) } } -#ifdef UTF2000 +#ifdef HAVE_GGC Lisp_Object make_older_vector (size_t length, Lisp_Object init) { @@ -1208,6 +1208,59 @@ make_older_vector (size_t length, Lisp_Object init) all_lcrecords = orig_all_lcrecords; return obj; } + +void make_vector_newer_1 (Lisp_Object v); +void +make_vector_newer_1 (Lisp_Object v) +{ + struct lcrecord_header* lcrecords = all_older_lcrecords; + + if (lcrecords != NULL) + { + if (lcrecords == XPNTR (v)) + { + lcrecords->lheader.older = 0; + all_older_lcrecords = all_older_lcrecords->next; + lcrecords->next = all_lcrecords; + all_lcrecords = lcrecords; + return; + } + else + { + struct lcrecord_header* plcrecords = lcrecords; + + lcrecords = lcrecords->next; + while (lcrecords != NULL) + { + if (lcrecords == XPNTR (v)) + { + lcrecords->lheader.older = 0; + plcrecords->next = lcrecords->next; + lcrecords->next = all_lcrecords; + all_lcrecords = lcrecords; + return; + } + plcrecords = lcrecords; + lcrecords = lcrecords->next; + } + } + } +} + +void +make_vector_newer (Lisp_Object v) +{ + int i; + + for (i = 0; i < XVECTOR_LENGTH (v); i++) + { + Lisp_Object obj = XVECTOR_DATA (v)[i]; + + if (VECTORP (obj) && !EQ (obj, v)) + make_vector_newer (obj); + } + make_vector_newer_1 (v); +} #endif DEFUN ("make-vector", Fmake_vector, 2, 2, 0, /*