aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
authorDmitry Antipov2012-08-08 10:11:29 +0400
committerDmitry Antipov2012-08-08 10:11:29 +0400
commit77c7bcb1157b405bde1227b20ef5f7ce9a90e689 (patch)
tree3daa729dc8fd54db0dff9ace5de1274e992a7d6b /src/alloc.c
parent9c08a8d4b549df18f815412d2a5494d28253179f (diff)
downloademacs-77c7bcb1157b405bde1227b20ef5f7ce9a90e689.tar.gz
emacs-77c7bcb1157b405bde1227b20ef5f7ce9a90e689.zip
Cleanup intervals.
* intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove. (NULL_INTERVAL_P): Likewise. Adjust users. (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P): Adjust comment. Move under #if 0. * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c: * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/src/alloc.c b/src/alloc.c
index b6fe6fa2eb3..d342a722ca6 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -1559,19 +1559,20 @@ mark_interval_tree (register INTERVAL tree)
1559 1559
1560/* Mark the interval tree rooted in I. */ 1560/* Mark the interval tree rooted in I. */
1561 1561
1562#define MARK_INTERVAL_TREE(i) \ 1562#define MARK_INTERVAL_TREE(i) \
1563 do { \ 1563 do { \
1564 if (!NULL_INTERVAL_P (i) && !i->gcmarkbit) \ 1564 if (i && !i->gcmarkbit) \
1565 mark_interval_tree (i); \ 1565 mark_interval_tree (i); \
1566 } while (0) 1566 } while (0)
1567 1567
1568/* Unmark and rebalance interval tree rooted in I. */
1568 1569
1569#define UNMARK_BALANCE_INTERVALS(i) \ 1570#define UNMARK_BALANCE_INTERVALS(i) \
1570 do { \ 1571 do { \
1571 if (! NULL_INTERVAL_P (i)) \ 1572 if (i) \
1572 (i) = balance_intervals (i); \ 1573 (i) = balance_intervals (i); \
1573 } while (0) 1574 } while (0)
1574 1575
1575/*********************************************************************** 1576/***********************************************************************
1576 String Allocation 1577 String Allocation
1577 ***********************************************************************/ 1578 ***********************************************************************/
@@ -2100,7 +2101,7 @@ sweep_strings (void)
2100 /* String is live; unmark it and its intervals. */ 2101 /* String is live; unmark it and its intervals. */
2101 UNMARK_STRING (s); 2102 UNMARK_STRING (s);
2102 2103
2103 if (!NULL_INTERVAL_P (s->intervals)) 2104 if (s->intervals)
2104 UNMARK_BALANCE_INTERVALS (s->intervals); 2105 UNMARK_BALANCE_INTERVALS (s->intervals);
2105 2106
2106 ++total_strings; 2107 ++total_strings;
@@ -2502,7 +2503,7 @@ make_uninit_multibyte_string (EMACS_INT nchars, EMACS_INT nbytes)
2502 return empty_multibyte_string; 2503 return empty_multibyte_string;
2503 2504
2504 s = allocate_string (); 2505 s = allocate_string ();
2505 s->intervals = NULL_INTERVAL; 2506 s->intervals = NULL;
2506 allocate_string_data (s, nchars, nbytes); 2507 allocate_string_data (s, nchars, nbytes);
2507 XSETSTRING (string, s); 2508 XSETSTRING (string, s);
2508 string_chars_consed += nbytes; 2509 string_chars_consed += nbytes;
@@ -5221,7 +5222,7 @@ make_pure_string (const char *data,
5221 } 5222 }
5222 s->size = nchars; 5223 s->size = nchars;
5223 s->size_byte = multibyte ? nbytes : -1; 5224 s->size_byte = multibyte ? nbytes : -1;
5224 s->intervals = NULL_INTERVAL; 5225 s->intervals = NULL;
5225 XSETSTRING (string, s); 5226 XSETSTRING (string, s);
5226 return string; 5227 return string;
5227} 5228}
@@ -5237,7 +5238,7 @@ make_pure_c_string (const char *data, ptrdiff_t nchars)
5237 s->size = nchars; 5238 s->size = nchars;
5238 s->size_byte = -1; 5239 s->size_byte = -1;
5239 s->data = (unsigned char *) data; 5240 s->data = (unsigned char *) data;
5240 s->intervals = NULL_INTERVAL; 5241 s->intervals = NULL;
5241 XSETSTRING (string, s); 5242 XSETSTRING (string, s);
5242 return string; 5243 return string;
5243} 5244}