comparison src/alloc.c @ 26372:f35140f031b4

Remove conditional compilation on USE_TEXT_PROPERTIES.
author Gerd Moellmann <gerd@gnu.org>
date Sun, 07 Nov 1999 15:52:40 +0000
parents 7b0217d9259c
children cbf297593a79
comparison
equal deleted inserted replaced
26371:9e9129128bef 26372:f35140f031b4
481 } 481 }
482 #endif 482 #endif
483 483
484 /* Interval allocation. */ 484 /* Interval allocation. */
485 485
486 #ifdef USE_TEXT_PROPERTIES
487 #define INTERVAL_BLOCK_SIZE \ 486 #define INTERVAL_BLOCK_SIZE \
488 ((1020 - sizeof (struct interval_block *)) / sizeof (struct interval)) 487 ((1020 - sizeof (struct interval_block *)) / sizeof (struct interval))
489 488
490 struct interval_block 489 struct interval_block
491 { 490 {
594 XUNMARK (* (Lisp_Object *) (&(i)->parent)); \ 593 XUNMARK (* (Lisp_Object *) (&(i)->parent)); \
595 (i) = balance_intervals (i); \ 594 (i) = balance_intervals (i); \
596 } \ 595 } \
597 } 596 }
598 597
599 #else /* no interval use */
600
601 #define INIT_INTERVALS
602
603 #define UNMARK_BALANCE_INTERVALS(i)
604 #define MARK_INTERVAL_TREE(i)
605
606 #endif /* no interval use */
607 598
608 /* Floating point allocation. */ 599 /* Floating point allocation. */
609 600
610 #ifdef LISP_FLOAT_TYPE 601 #ifdef LISP_FLOAT_TYPE
611 /* Allocation of float cells, just like conses */ 602 /* Allocation of float cells, just like conses */
1552 bcopy (data, XSTRING (new)->data, length_byte); 1543 bcopy (data, XSTRING (new)->data, length_byte);
1553 XSTRING (new)->data[length_byte] = 0; 1544 XSTRING (new)->data[length_byte] = 0;
1554 1545
1555 /* We must give strings in pure storage some kind of interval. So we 1546 /* We must give strings in pure storage some kind of interval. So we
1556 give them a null one. */ 1547 give them a null one. */
1557 #if defined (USE_TEXT_PROPERTIES)
1558 XSTRING (new)->intervals = NULL_INTERVAL; 1548 XSTRING (new)->intervals = NULL_INTERVAL;
1559 #endif
1560 pureptr += size; 1549 pureptr += size;
1561 return new; 1550 return new;
1562 } 1551 }
1563 1552
1564 Lisp_Object 1553 Lisp_Object
1970 make_number (total_free_floats)), 1959 make_number (total_free_floats)),
1971 #else /* not LISP_FLOAT_TYPE */ 1960 #else /* not LISP_FLOAT_TYPE */
1972 (make_number (0), make_number (0)), 1961 (make_number (0), make_number (0)),
1973 #endif /* not LISP_FLOAT_TYPE */ 1962 #endif /* not LISP_FLOAT_TYPE */
1974 Fcons (Fcons 1963 Fcons (Fcons
1975 #ifdef USE_TEXT_PROPERTIES
1976 (make_number (total_intervals), 1964 (make_number (total_intervals),
1977 make_number (total_free_intervals)), 1965 make_number (total_free_intervals)),
1978 #else /* not USE_TEXT_PROPERTIES */
1979 (make_number (0), make_number (0)),
1980 #endif /* not USE_TEXT_PROPERTIES */
1981 Qnil))))))); 1966 Qnil)))))));
1982 } 1967 }
1983 1968
1984 #if 0 1969 #if 0
1985 static void 1970 static void
2785 total_floats = num_used; 2770 total_floats = num_used;
2786 total_free_floats = num_free; 2771 total_free_floats = num_free;
2787 } 2772 }
2788 #endif /* LISP_FLOAT_TYPE */ 2773 #endif /* LISP_FLOAT_TYPE */
2789 2774
2790 #ifdef USE_TEXT_PROPERTIES
2791 /* Put all unmarked intervals on free list */ 2775 /* Put all unmarked intervals on free list */
2792 { 2776 {
2793 register struct interval_block *iblk; 2777 register struct interval_block *iblk;
2794 struct interval_block **iprev = &interval_block; 2778 struct interval_block **iprev = &interval_block;
2795 register int lim = interval_block_index; 2779 register int lim = interval_block_index;
2835 } 2819 }
2836 } 2820 }
2837 total_intervals = num_used; 2821 total_intervals = num_used;
2838 total_free_intervals = num_free; 2822 total_free_intervals = num_free;
2839 } 2823 }
2840 #endif /* USE_TEXT_PROPERTIES */
2841 2824
2842 /* Put all unmarked symbols on free list */ 2825 /* Put all unmarked symbols on free list */
2843 { 2826 {
2844 register struct symbol_block *sblk; 2827 register struct symbol_block *sblk;
2845 struct symbol_block **sprev = &symbol_block; 2828 struct symbol_block **sprev = &symbol_block;
3174 XSETSTRING (*objptr, newaddr); 3157 XSETSTRING (*objptr, newaddr);
3175 } 3158 }
3176 /* Store the actual size in the size field. */ 3159 /* Store the actual size in the size field. */
3177 newaddr->size = size; 3160 newaddr->size = size;
3178 3161
3179 #ifdef USE_TEXT_PROPERTIES
3180 /* Now that the string has been relocated, rebalance its 3162 /* Now that the string has been relocated, rebalance its
3181 interval tree, and update the tree's parent pointer. */ 3163 interval tree, and update the tree's parent pointer. */
3182 if (! NULL_INTERVAL_P (newaddr->intervals)) 3164 if (! NULL_INTERVAL_P (newaddr->intervals))
3183 { 3165 {
3184 UNMARK_BALANCE_INTERVALS (newaddr->intervals); 3166 UNMARK_BALANCE_INTERVALS (newaddr->intervals);
3185 XSETSTRING (* (Lisp_Object *) &newaddr->intervals->parent, 3167 XSETSTRING (* (Lisp_Object *) &newaddr->intervals->parent,
3186 newaddr); 3168 newaddr);
3187 } 3169 }
3188 #endif /* USE_TEXT_PROPERTIES */
3189 } 3170 }
3190 else if (size_byte < 0) 3171 else if (size_byte < 0)
3191 size_byte = size; 3172 size_byte = size;
3192 3173
3193 pos += STRING_FULLSIZE (size_byte); 3174 pos += STRING_FULLSIZE (size_byte);