From dc6817c0ec6239f54949f21e7a75294592589e6d Mon Sep 17 00:00:00 2001 From: tomo Date: Fri, 16 Jun 2000 11:52:12 +0000 Subject: [PATCH] (make_vector_newer_1): New function. (make_vector_newer): New function. --- src/alloc.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) 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, /* -- 1.7.10.4