summaryrefslogtreecommitdiffstats
path: root/rope.c
diff options
context:
space:
mode:
authorRob Browning <rlb@cs.utexas.edu>1997-12-12 17:29:42 -0600
committerBryan Newbold <bnewbold@robocracy.org>2017-02-20 00:05:24 -0800
commitf64b2806c1d66a1341bb8b1491f384169ab1d65f (patch)
tree8b97dbe3640c60927959b0e63461ef9fcae591e0 /rope.c
parent6dcb175d7f34d9f5a0b3ba623f94454ec16a73d6 (diff)
parent1edcb9b62a1a520eddae8403c19d841c9b18737f (diff)
downloadscm-f64b2806c1d66a1341bb8b1491f384169ab1d65f.tar.gz
scm-f64b2806c1d66a1341bb8b1491f384169ab1d65f.zip
Import Debian changes 5b3-1debian/5b3-1
scm (5b3-1) unstable; urgency=low * New maintainer * New version * libc6
Diffstat (limited to 'rope.c')
-rw-r--r--rope.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/rope.c b/rope.c
index c922046..94b6631 100644
--- a/rope.c
+++ b/rope.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1997 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -330,6 +330,35 @@ unsigned long scm_addr(args, s_name)
}
#endif /* ARRAYS */
+/* scm_cell_p() returns !0 if the SCM argument `x' is cell-aligned and
+ points into a valid heap segment. This code is duplicated from
+ mark_locations() and obunhash() in "sys.c", which means that
+ changes to these routines must be coordinated. */
+
+#include "continue.h"
+extern sizet hplim_ind;
+extern CELLPTR *hplims;
+
+int scm_cell_p(x)
+ SCM x;
+{
+ register int i, j;
+ register CELLPTR ptr;
+ if NCELLP(x) return 0;
+ ptr = (CELLPTR)SCM2PTR(x);
+ i = 0;
+ j = hplim_ind;
+ do {
+ if PTR_GT(hplims[i++], ptr) break;
+ if PTR_LE(hplims[--j], ptr) break;
+ if ((i != j)
+ && PTR_LE(hplims[i++], ptr)
+ && PTR_GT(hplims[--j], ptr)) continue;
+ return !0; /* NFREEP(x) */
+ } while(i<j);
+ return 0;
+}
+
void init_rope()
{
}