Mercurial > hg > xemacs-beta
comparison src/extents.c @ 5120:d1247f3cc363 ben-lisp-object
latest work on lisp-object workspace;
more changes eliminating LCRECORD in place of LISP_OBJECT;
now compiles and runs.
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Mon, 28 Dec 2009 01:15:52 -0600 |
parents | e0db3c197671 |
children | 623d57b7fbe8 |
comparison
equal
deleted
inserted
replaced
5119:d877c14318b3 | 5120:d1247f3cc363 |
---|---|
241 deleted, similar to standard markers. */ | 241 deleted, similar to standard markers. */ |
242 | 242 |
243 typedef struct gap_array_marker | 243 typedef struct gap_array_marker |
244 { | 244 { |
245 #ifdef NEW_GC | 245 #ifdef NEW_GC |
246 struct lrecord_header header; | 246 LISP_OBJECT_HEADER header; |
247 #endif /* NEW_GC */ | 247 #endif /* NEW_GC */ |
248 int pos; | 248 int pos; |
249 struct gap_array_marker *next; | 249 struct gap_array_marker *next; |
250 } Gap_Array_Marker; | 250 } Gap_Array_Marker; |
251 | 251 |
271 | 271 |
272 | 272 |
273 typedef struct gap_array | 273 typedef struct gap_array |
274 { | 274 { |
275 #ifdef NEW_GC | 275 #ifdef NEW_GC |
276 struct lrecord_header header; | 276 LISP_OBJECT_HEADER header; |
277 #endif /* NEW_GC */ | 277 #endif /* NEW_GC */ |
278 Elemcount gap; | 278 Elemcount gap; |
279 Elemcount gapsize; | 279 Elemcount gapsize; |
280 Elemcount numels; | 280 Elemcount numels; |
281 Bytecount elsize; | 281 Bytecount elsize; |
317 /* ------------------------------- */ | 317 /* ------------------------------- */ |
318 | 318 |
319 typedef struct extent_list_marker | 319 typedef struct extent_list_marker |
320 { | 320 { |
321 #ifdef NEW_GC | 321 #ifdef NEW_GC |
322 struct lrecord_header header; | 322 LISP_OBJECT_HEADER header; |
323 #endif /* NEW_GC */ | 323 #endif /* NEW_GC */ |
324 Gap_Array_Marker *m; | 324 Gap_Array_Marker *m; |
325 int endp; | 325 int endp; |
326 struct extent_list_marker *next; | 326 struct extent_list_marker *next; |
327 } Extent_List_Marker; | 327 } Extent_List_Marker; |
328 | 328 |
329 typedef struct extent_list | 329 typedef struct extent_list |
330 { | 330 { |
331 #ifdef NEW_GC | 331 #ifdef NEW_GC |
332 struct lrecord_header header; | 332 LISP_OBJECT_HEADER header; |
333 #endif /* NEW_GC */ | 333 #endif /* NEW_GC */ |
334 Gap_Array *start; | 334 Gap_Array *start; |
335 Gap_Array *end; | 335 Gap_Array *end; |
336 Extent_List_Marker *markers; | 336 Extent_List_Marker *markers; |
337 } Extent_List; | 337 } Extent_List; |
392 /* ------------------------------- */ | 392 /* ------------------------------- */ |
393 | 393 |
394 typedef struct stack_of_extents | 394 typedef struct stack_of_extents |
395 { | 395 { |
396 #ifdef NEW_GC | 396 #ifdef NEW_GC |
397 struct lrecord_header header; | 397 LISP_OBJECT_HEADER header; |
398 #endif /* NEW_GC */ | 398 #endif /* NEW_GC */ |
399 Extent_List *extents; | 399 Extent_List *extents; |
400 Memxpos pos; /* Position of stack of extents. EXTENTS is the list of | 400 Memxpos pos; /* Position of stack of extents. EXTENTS is the list of |
401 all extents that overlap this position. This position | 401 all extents that overlap this position. This position |
402 can be -1 if the stack of extents is invalid (this | 402 can be -1 if the stack of extents is invalid (this |
689 { | 689 { |
690 Gap_Array_Marker *m; | 690 Gap_Array_Marker *m; |
691 | 691 |
692 assert (pos >= 0 && pos <= ga->numels); | 692 assert (pos >= 0 && pos <= ga->numels); |
693 #ifdef NEW_GC | 693 #ifdef NEW_GC |
694 m = alloc_lrecord_type (Gap_Array_Marker, &lrecord_gap_array_marker); | 694 m = XGAP_ARRAY_MARKER (ALLOC_LISP_OBJECT (gap_array_marker)); |
695 #else /* not NEW_GC */ | 695 #else /* not NEW_GC */ |
696 if (gap_array_marker_freelist) | 696 if (gap_array_marker_freelist) |
697 { | 697 { |
698 m = gap_array_marker_freelist; | 698 m = gap_array_marker_freelist; |
699 gap_array_marker_freelist = gap_array_marker_freelist->next; | 699 gap_array_marker_freelist = gap_array_marker_freelist->next; |
755 | 755 |
756 static Gap_Array * | 756 static Gap_Array * |
757 make_gap_array (Elemcount elsize) | 757 make_gap_array (Elemcount elsize) |
758 { | 758 { |
759 #ifdef NEW_GC | 759 #ifdef NEW_GC |
760 Gap_Array *ga = alloc_lrecord_type (Gap_Array, &lrecord_gap_array); | 760 Gap_Array *ga = XGAP_ARRAY (ALLOC_SIZED_LISP_OBJECT (sizeof (Gap_Array), |
761 gap_array)); | |
761 #else /* not NEW_GC */ | 762 #else /* not NEW_GC */ |
762 Gap_Array *ga = xnew_and_zero (Gap_Array); | 763 Gap_Array *ga = xnew_and_zero (Gap_Array); |
763 #endif /* not NEW_GC */ | 764 #endif /* not NEW_GC */ |
764 ga->elsize = elsize; | 765 ga->elsize = elsize; |
765 return ga; | 766 return ga; |
926 extent_list_make_marker (Extent_List *el, int pos, int endp) | 927 extent_list_make_marker (Extent_List *el, int pos, int endp) |
927 { | 928 { |
928 Extent_List_Marker *m; | 929 Extent_List_Marker *m; |
929 | 930 |
930 #ifdef NEW_GC | 931 #ifdef NEW_GC |
931 m = alloc_lrecord_type (Extent_List_Marker, &lrecord_extent_list_marker); | 932 m = XEXTENT_LIST_MARKER (ALLOC_LISP_OBJECT (extent_list_marker)); |
932 #else /* not NEW_GC */ | 933 #else /* not NEW_GC */ |
933 if (extent_list_marker_freelist) | 934 if (extent_list_marker_freelist) |
934 { | 935 { |
935 m = extent_list_marker_freelist; | 936 m = extent_list_marker_freelist; |
936 extent_list_marker_freelist = extent_list_marker_freelist->next; | 937 extent_list_marker_freelist = extent_list_marker_freelist->next; |
975 | 976 |
976 static Extent_List * | 977 static Extent_List * |
977 allocate_extent_list (void) | 978 allocate_extent_list (void) |
978 { | 979 { |
979 #ifdef NEW_GC | 980 #ifdef NEW_GC |
980 Extent_List *el = alloc_lrecord_type (Extent_List, &lrecord_extent_list); | 981 Extent_List *el = XEXTENT_LIST (ALLOC_LISP_OBJECT (extent_list)); |
981 #else /* not NEW_GC */ | 982 #else /* not NEW_GC */ |
982 Extent_List *el = xnew (Extent_List); | 983 Extent_List *el = xnew (Extent_List); |
983 #endif /* not NEW_GC */ | 984 #endif /* not NEW_GC */ |
984 el->start = make_gap_array (sizeof (EXTENT)); | 985 el->start = make_gap_array (sizeof (EXTENT)); |
985 el->end = make_gap_array (sizeof (EXTENT)); | 986 el->end = make_gap_array (sizeof (EXTENT)); |
1040 allocate_extent_auxiliary (EXTENT ext) | 1041 allocate_extent_auxiliary (EXTENT ext) |
1041 { | 1042 { |
1042 Lisp_Object obj = ALLOC_LISP_OBJECT (extent_auxiliary); | 1043 Lisp_Object obj = ALLOC_LISP_OBJECT (extent_auxiliary); |
1043 struct extent_auxiliary *data = XEXTENT_AUXILIARY (obj); | 1044 struct extent_auxiliary *data = XEXTENT_AUXILIARY (obj); |
1044 | 1045 |
1045 COPY_LCRECORD (data, &extent_auxiliary_defaults); | 1046 COPY_LISP_OBJECT (data, &extent_auxiliary_defaults); |
1046 ext->plist = Fcons (obj, ext->plist); | 1047 ext->plist = Fcons (obj, ext->plist); |
1047 ext->flags.has_aux = 1; | 1048 ext->flags.has_aux = 1; |
1048 } | 1049 } |
1049 | 1050 |
1050 | 1051 |
1784 | 1785 |
1785 static struct stack_of_extents * | 1786 static struct stack_of_extents * |
1786 allocate_soe (void) | 1787 allocate_soe (void) |
1787 { | 1788 { |
1788 #ifdef NEW_GC | 1789 #ifdef NEW_GC |
1789 struct stack_of_extents *soe = | 1790 struct stack_of_extents *soe = |
1790 alloc_lrecord_type (struct stack_of_extents, &lrecord_stack_of_extents); | 1791 XSTACK_OF_EXTENTS (ALLOC_LISP_OBJECT (stack_of_extents)); |
1791 #else /* not NEW_GC */ | 1792 #else /* not NEW_GC */ |
1792 struct stack_of_extents *soe = xnew_and_zero (struct stack_of_extents); | 1793 struct stack_of_extents *soe = xnew_and_zero (struct stack_of_extents); |
1793 #endif /* not NEW_GC */ | 1794 #endif /* not NEW_GC */ |
1794 soe->extents = allocate_extent_list (); | 1795 soe->extents = allocate_extent_list (); |
1795 soe->pos = -1; | 1796 soe->pos = -1; |
4040 this extent to share the same aux struct as the original | 4041 this extent to share the same aux struct as the original |
4041 one. */ | 4042 one. */ |
4042 Lisp_Object ea = ALLOC_LISP_OBJECT (extent_auxiliary); | 4043 Lisp_Object ea = ALLOC_LISP_OBJECT (extent_auxiliary); |
4043 struct extent_auxiliary *data = XEXTENT_AUXILIARY (ea); | 4044 struct extent_auxiliary *data = XEXTENT_AUXILIARY (ea); |
4044 | 4045 |
4045 COPY_LCRECORD (data, XEXTENT_AUXILIARY (XCAR (original->plist))); | 4046 COPY_LISP_OBJECT (data, XEXTENT_AUXILIARY (XCAR (original->plist))); |
4046 XCAR (e->plist) = ea; | 4047 XCAR (e->plist) = ea; |
4047 } | 4048 } |
4048 | 4049 |
4049 { | 4050 { |
4050 /* we may have just added another child to the parent extent. */ | 4051 /* we may have just added another child to the parent extent. */ |