Mercurial > hg > xemacs-beta
comparison src/syntax.c @ 3092:141c2920ea48
[xemacs-hg @ 2005-11-25 01:41:31 by crestani]
Incremental Garbage Collector
author | crestani |
---|---|
date | Fri, 25 Nov 2005 01:42:08 +0000 |
parents | facf3239ba30 |
children | b85f5d7d9d82 |
comparison
equal
deleted
inserted
replaced
3091:c22d8984148c | 3092:141c2920ea48 |
---|---|
307 { XD_LISP_OBJECT, offsetof (struct syntax_cache, start) }, | 307 { XD_LISP_OBJECT, offsetof (struct syntax_cache, start) }, |
308 { XD_LISP_OBJECT, offsetof (struct syntax_cache, end) }, | 308 { XD_LISP_OBJECT, offsetof (struct syntax_cache, end) }, |
309 { XD_END } | 309 { XD_END } |
310 }; | 310 }; |
311 | 311 |
312 #ifdef NEW_GC | |
313 DEFINE_LRECORD_IMPLEMENTATION ("syntax-cache", syntax_cache, | |
314 1, /*dumpable-flag*/ | |
315 0, 0, 0, 0, 0, | |
316 syntax_cache_description_1, | |
317 Lisp_Syntax_Cache); | |
318 #else /* not NEW_GC */ | |
319 | |
312 const struct sized_memory_description syntax_cache_description = { | 320 const struct sized_memory_description syntax_cache_description = { |
313 sizeof (struct syntax_cache), | 321 sizeof (struct syntax_cache), |
314 syntax_cache_description_1 | 322 syntax_cache_description_1 |
315 }; | 323 }; |
324 #endif /* not NEW_GC */ | |
316 | 325 |
317 void | 326 void |
318 mark_buffer_syntax_cache (struct buffer *buf) | 327 mark_buffer_syntax_cache (struct buffer *buf) |
319 { | 328 { |
320 struct syntax_cache *cache = buf->syntax_cache; | 329 struct syntax_cache *cache = buf->syntax_cache; |
342 | 351 |
343 void | 352 void |
344 init_buffer_syntax_cache (struct buffer *buf) | 353 init_buffer_syntax_cache (struct buffer *buf) |
345 { | 354 { |
346 struct syntax_cache *cache; | 355 struct syntax_cache *cache; |
356 #ifdef NEW_GC | |
357 buf->syntax_cache = alloc_lrecord_type (struct syntax_cache, | |
358 &lrecord_syntax_cache); | |
359 #else /* not NEW_GC */ | |
347 buf->syntax_cache = xnew_and_zero (struct syntax_cache); | 360 buf->syntax_cache = xnew_and_zero (struct syntax_cache); |
361 #endif /* not NEW_GC */ | |
348 cache = buf->syntax_cache; | 362 cache = buf->syntax_cache; |
349 cache->object = wrap_buffer (buf); | 363 cache->object = wrap_buffer (buf); |
350 cache->buffer = buf; | 364 cache->buffer = buf; |
351 cache->no_syntax_table_prop = 1; | 365 cache->no_syntax_table_prop = 1; |
352 cache->syntax_table = BUFFER_SYNTAX_TABLE (cache->buffer); | 366 cache->syntax_table = BUFFER_SYNTAX_TABLE (cache->buffer); |
357 } | 371 } |
358 | 372 |
359 void | 373 void |
360 uninit_buffer_syntax_cache (struct buffer *buf) | 374 uninit_buffer_syntax_cache (struct buffer *buf) |
361 { | 375 { |
376 #ifdef NEW_GC | |
377 mc_free (buf->syntax_cache); | |
378 #else /* not NEW_GC */ | |
362 xfree (buf->syntax_cache, struct syntax_cache *); | 379 xfree (buf->syntax_cache, struct syntax_cache *); |
380 #endif /* not NEW_GC */ | |
363 buf->syntax_cache = 0; | 381 buf->syntax_cache = 0; |
364 } | 382 } |
365 | 383 |
366 | 384 |
367 static void | 385 static void |
2311 /************************************************************************/ | 2329 /************************************************************************/ |
2312 | 2330 |
2313 void | 2331 void |
2314 syms_of_syntax (void) | 2332 syms_of_syntax (void) |
2315 { | 2333 { |
2334 #ifdef NEW_GC | |
2335 INIT_LRECORD_IMPLEMENTATION (syntax_cache); | |
2336 #endif /* NEW_GC */ | |
2316 DEFSYMBOL (Qsyntax_table_p); | 2337 DEFSYMBOL (Qsyntax_table_p); |
2317 DEFSYMBOL (Qsyntax_table); | 2338 DEFSYMBOL (Qsyntax_table); |
2318 | 2339 |
2319 DEFSUBR (Fsyntax_table_p); | 2340 DEFSUBR (Fsyntax_table_p); |
2320 DEFSUBR (Fsyntax_table); | 2341 DEFSUBR (Fsyntax_table); |