From: tomo Date: Fri, 16 Jun 2000 11:52:12 +0000 (+0000) Subject: (make_vector_newer_1): New function. X-Git-Tag: r21-2-34-utf-2000-0_16-1~23 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=dc6817c0ec6239f54949f21e7a75294592589e6d;p=chise%2Fxemacs-chise.git (make_vector_newer_1): New function. (make_vector_newer): New function. --- diff --git a/src/alloc.c b/src/alloc.c index 92a11a4..1d1d78d 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -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, /*