comparison src/symbols.c @ 251:677f6a0ee643 r20-5b24

Import from CVS: tag r20-5b24
author cvs
date Mon, 13 Aug 2007 10:19:59 +0200
parents e70b3a057e12
children 966663fcf606
comparison
equal deleted inserted replaced
250:f385a461c9aa 251:677f6a0ee643
102 struct Lisp_Symbol *sym = XSYMBOL (obj); 102 struct Lisp_Symbol *sym = XSYMBOL (obj);
103 Lisp_Object pname; 103 Lisp_Object pname;
104 104
105 ((markobj) (sym->value)); 105 ((markobj) (sym->value));
106 ((markobj) (sym->function)); 106 ((markobj) (sym->function));
107 /* DON'T mark through ->obarray slot. Since the slot is not visible 107 /* No need to mark through ->obarray, because it only holds nil or t. */
108 from Lisp, it would be wrong not to gc an obarray vector only
109 because there are symbols pointing to it. This is safe, because
110 we only check the nil-ness of the object. An implication of this
111 is that, when the obarray vector is gc-ed, its symbols are still
112 considered "interned" for printing purposes -- but it's probably
113 no big deal. */
114 /*((markobj) (sym->obarray));*/ 108 /*((markobj) (sym->obarray));*/
115 XSETSTRING (pname, sym->name); 109 XSETSTRING (pname, sym->name);
116 ((markobj) (pname)); 110 ((markobj) (pname));
117 if (!symbol_next (sym)) 111 if (!symbol_next (sym))
118 return sym->plist; 112 return sym->plist;
199 ptr = &XVECTOR_DATA (obarray)[XINT (sym)]; 193 ptr = &XVECTOR_DATA (obarray)[XINT (sym)];
200 194
201 if (purify_flag && ! purified (str)) 195 if (purify_flag && ! purified (str))
202 str = make_pure_pname (XSTRING_DATA (str), len, 0); 196 str = make_pure_pname (XSTRING_DATA (str), len, 0);
203 sym = Fmake_symbol (str); 197 sym = Fmake_symbol (str);
204 XSYMBOL (sym)->obarray = obarray; 198 /* FSFmacs places OBARRAY here, but it is pointless because we do
199 not mark through this slot, so it is not usable later (because
200 the obarray might have been collected). Marking through the
201 ->obarray slot is an even worse idea, because it would keep
202 obarrays from being collected because of symbols pointed to them. */
203 XSYMBOL (sym)->obarray = Qt;
205 204
206 if (SYMBOLP (*ptr)) 205 if (SYMBOLP (*ptr))
207 symbol_next (XSYMBOL (sym)) = XSYMBOL (*ptr); 206 symbol_next (XSYMBOL (sym)) = XSYMBOL (*ptr);
208 else 207 else
209 symbol_next (XSYMBOL (sym)) = 0; 208 symbol_next (XSYMBOL (sym)) = 0;
3172 hash = hash_string (string_data (XSYMBOL (Qnil)->name), 3); 3171 hash = hash_string (string_data (XSYMBOL (Qnil)->name), 3);
3173 /* Separate statement here to avoid VAXC bug. */ 3172 /* Separate statement here to avoid VAXC bug. */
3174 hash %= OBARRAY_SIZE; 3173 hash %= OBARRAY_SIZE;
3175 tem = &XVECTOR_DATA (Vobarray)[hash]; 3174 tem = &XVECTOR_DATA (Vobarray)[hash];
3176 *tem = Qnil; 3175 *tem = Qnil;
3177 XSYMBOL (Qnil)->obarray = Vobarray; 3176 XSYMBOL (Qnil)->obarray = Qt;
3178 } 3177 }
3179 3178
3180 { 3179 {
3181 /* Required to get around a GCC syntax error on certain 3180 /* Required to get around a GCC syntax error on certain
3182 architectures */ 3181 architectures */