comparison src/alloc.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
1198 #define FREE_FIXED_TYPE_WHEN_NOT_IN_GC(type, structtype, ptr) 1198 #define FREE_FIXED_TYPE_WHEN_NOT_IN_GC(type, structtype, ptr)
1199 #endif 1199 #endif
1200 #endif /* NEW_GC */ 1200 #endif /* NEW_GC */
1201 1201
1202 #ifdef NEW_GC 1202 #ifdef NEW_GC
1203 #define ALLOCATE_FIXED_TYPE_AND_SET_IMPL(type, lisp_type, var, lrec_ptr) \ 1203 #define ALLOCATE_FIXED_TYPE_AND_SET_IMPL(type, lisp_type, var, lrec_ptr)\
1204 do { \ 1204 do { \
1205 (var) = alloc_lrecord_type (lisp_type, lrec_ptr); \ 1205 (var) = (lisp_type *) XPNTR (ALLOC_LISP_OBJECT (type)); \
1206 } while (0) 1206 } while (0)
1207 #define NOSEEUM_ALLOCATE_FIXED_TYPE_AND_SET_IMPL(type, lisp_type, var, \ 1207 #define NOSEEUM_ALLOCATE_FIXED_TYPE_AND_SET_IMPL(type, lisp_type, var, \
1208 lrec_ptr) \ 1208 lrec_ptr) \
1209 do { \ 1209 do { \
1210 (var) = noseeum_alloc_lrecord_type (lisp_type, lrec_ptr); \ 1210 (var) = (lisp_type *) XPNTR (noseeum_alloc_lrecord (lrec_ptr)); \
1211 } while (0) 1211 } while (0)
1212 #else /* not NEW_GC */ 1212 #else /* not NEW_GC */
1213 #define ALLOCATE_FIXED_TYPE_AND_SET_IMPL(type, lisp_type, var, lrec_ptr) \ 1213 #define ALLOCATE_FIXED_TYPE_AND_SET_IMPL(type, lisp_type, var, lrec_ptr) \
1214 do \ 1214 do \
1215 { \ 1215 { \
2536 Bytecount fullsize = STRING_FULLSIZE (length); 2536 Bytecount fullsize = STRING_FULLSIZE (length);
2537 2537
2538 assert (length >= 0 && fullsize > 0); 2538 assert (length >= 0 && fullsize > 0);
2539 2539
2540 #ifdef NEW_GC 2540 #ifdef NEW_GC
2541 s = alloc_lrecord_type (Lisp_String, &lrecord_string); 2541 s = XSTRING (ALLOC_LISP_OBJECT (string));
2542 #else /* not NEW_GC */ 2542 #else /* not NEW_GC */
2543 /* Allocate the string header */ 2543 /* Allocate the string header */
2544 ALLOCATE_FIXED_TYPE (string, Lisp_String, s); 2544 ALLOCATE_FIXED_TYPE (string, Lisp_String, s);
2545 xzero (*s); 2545 xzero (*s);
2546 set_lheader_implementation (&s->u.lheader, &lrecord_string); 2546 set_lheader_implementation (&s->u.lheader, &lrecord_string);
2944 #if defined (ERROR_CHECK_TEXT) && defined (MULE) 2944 #if defined (ERROR_CHECK_TEXT) && defined (MULE)
2945 bytecount_to_charcount (contents, length); /* Just for the assertions */ 2945 bytecount_to_charcount (contents, length); /* Just for the assertions */
2946 #endif 2946 #endif
2947 2947
2948 #ifdef NEW_GC 2948 #ifdef NEW_GC
2949 s = alloc_lrecord_type (Lisp_String, &lrecord_string); 2949 s = XSTRING (ALLOC_LISP_OBJECT (string));
2950 mcpro (wrap_pointer_1 (s)); /* otherwise nocopy_strings get 2950 mcpro (wrap_pointer_1 (s)); /* otherwise nocopy_strings get
2951 collected and static data is tried to 2951 collected and static data is tried to
2952 be freed. */ 2952 be freed. */
2953 #else /* not NEW_GC */ 2953 #else /* not NEW_GC */
2954 /* Allocate the string header */ 2954 /* Allocate the string header */
2959 /* Don't need to XSET_STRING_ASCII_BEGIN() here because it happens in 2959 /* Don't need to XSET_STRING_ASCII_BEGIN() here because it happens in
2960 init_string_ascii_begin(). */ 2960 init_string_ascii_begin(). */
2961 s->plist = Qnil; 2961 s->plist = Qnil;
2962 #ifdef NEW_GC 2962 #ifdef NEW_GC
2963 set_lispstringp_indirect (s); 2963 set_lispstringp_indirect (s);
2964 STRING_DATA_OBJECT (s) = 2964 STRING_DATA_OBJECT (s) = ALLOC_LISP_OBJECT (string_indirect_data);
2965 wrap_string_indirect_data
2966 (alloc_lrecord_type (Lisp_String_Indirect_Data,
2967 &lrecord_string_indirect_data));
2968 XSTRING_INDIRECT_DATA_DATA (STRING_DATA_OBJECT (s)) = (Ibyte *) contents; 2965 XSTRING_INDIRECT_DATA_DATA (STRING_DATA_OBJECT (s)) = (Ibyte *) contents;
2969 XSTRING_INDIRECT_DATA_SIZE (STRING_DATA_OBJECT (s)) = length; 2966 XSTRING_INDIRECT_DATA_SIZE (STRING_DATA_OBJECT (s)) = length;
2970 #else /* not NEW_GC */ 2967 #else /* not NEW_GC */
2971 set_lispstringp_data (s, (Ibyte *) contents); 2968 set_lispstringp_data (s, (Ibyte *) contents);
2972 set_lispstringp_length (s, length); 2969 set_lispstringp_length (s, length);