comparison src/chartab.c @ 3017:1e7cc382eb16

[xemacs-hg @ 2005-10-24 10:07:26 by ben] refactor mc-alloc dependencies next-error.el, occur.el: Fix some byte-compile warnings. alloc.c, buffer.c, buffer.h, casetab.c, casetab.h, charset.h, chartab.c, chartab.h, console-impl.h, console-msw-impl.h, console.c, data.c, database.c, device-impl.h, device-msw.c, device.c, dialog-msw.c, elhash.c, events.h, extents-impl.h, extents.c, faces.c, faces.h, file-coding.c, file-coding.h, frame-impl.h, frame.c, glyphs.c, glyphs.h, gui.c, gui.h, keymap.c, lisp.h, lrecord.h, lstream.c, lstream.h, mule-charset.c, objects-impl.h, objects.c, opaque.c, opaque.h, print.c, process.c, procimpl.h, rangetab.c, rangetab.h, scrollbar-gtk.c, scrollbar-msw.c, scrollbar-x.c, scrollbar.c, scrollbar.h, specifier.c, specifier.h, symbols.c, symeval.h, toolbar.c, toolbar.h, tooltalk.c, ui-gtk.c, ui-gtk.h, unicode.c, window-impl.h, window.c: Eliminate the majority of #ifdef MC_ALLOC occurrences through macros LCRECORD_HEADER, ALLOC_LCRECORD_TYPE, MALLOCED_STORAGE_SIZE, etc. (defined in lrecord.h).
author ben
date Mon, 24 Oct 2005 10:07:42 +0000
parents 4bc213965183
children facf3239ba30
comparison
equal deleted inserted replaced
3016:f252275fb013 3017:1e7cc382eb16
474 /* Don't get stymied when initting the table, or when trying to 474 /* Don't get stymied when initting the table, or when trying to
475 free a pdump object. */ 475 free a pdump object. */
476 if (!EQ (ct->level1[i], Qnull_pointer) && 476 if (!EQ (ct->level1[i], Qnull_pointer) &&
477 CHAR_TABLE_ENTRYP (ct->level1[i]) && 477 CHAR_TABLE_ENTRYP (ct->level1[i]) &&
478 !OBJECT_DUMPED_P (ct->level1[1])) 478 !OBJECT_DUMPED_P (ct->level1[1]))
479 #ifdef MC_ALLOC 479 FREE_LCRECORD (ct->level1[i]);
480 free_lrecord (ct->level1[i]);
481 #else /* not MC_ALLOC */
482 free_lcrecord (ct->level1[i]);
483 #endif /* not MC_ALLOC */
484 ct->level1[i] = value; 480 ct->level1[i] = value;
485 } 481 }
486 #endif /* MULE */ 482 #endif /* MULE */
487 483
488 if (ct->type == CHAR_TABLE_TYPE_SYNTAX) 484 if (ct->type == CHAR_TABLE_TYPE_SYNTAX)
594 { 590 {
595 Lisp_Char_Table *ct; 591 Lisp_Char_Table *ct;
596 Lisp_Object obj; 592 Lisp_Object obj;
597 enum char_table_type ty = symbol_to_char_table_type (type); 593 enum char_table_type ty = symbol_to_char_table_type (type);
598 594
599 #ifdef MC_ALLOC 595 ct = ALLOC_LCRECORD_TYPE (Lisp_Char_Table, &lrecord_char_table);
600 ct = alloc_lrecord_type (Lisp_Char_Table, &lrecord_char_table);
601 #else /* not MC_ALLOC */
602 ct = alloc_lcrecord_type (Lisp_Char_Table, &lrecord_char_table);
603 #endif /* not MC_ALLOC */
604 ct->type = ty; 596 ct->type = ty;
605 obj = wrap_char_table (ct); 597 obj = wrap_char_table (ct);
606 if (ty == CHAR_TABLE_TYPE_SYNTAX) 598 if (ty == CHAR_TABLE_TYPE_SYNTAX)
607 { 599 {
608 /* Qgeneric not Qsyntax because a syntax table has a mirror table 600 /* Qgeneric not Qsyntax because a syntax table has a mirror table
631 static Lisp_Object 623 static Lisp_Object
632 make_char_table_entry (Lisp_Object initval) 624 make_char_table_entry (Lisp_Object initval)
633 { 625 {
634 int i; 626 int i;
635 Lisp_Char_Table_Entry *cte = 627 Lisp_Char_Table_Entry *cte =
636 #ifdef MC_ALLOC 628 ALLOC_LCRECORD_TYPE (Lisp_Char_Table_Entry, &lrecord_char_table_entry);
637 alloc_lrecord_type (Lisp_Char_Table_Entry, &lrecord_char_table_entry);
638 #else /* not MC_ALLOC */
639 alloc_lcrecord_type (Lisp_Char_Table_Entry, &lrecord_char_table_entry);
640 #endif /* not MC_ALLOC */
641 629
642 for (i = 0; i < 96; i++) 630 for (i = 0; i < 96; i++)
643 cte->level2[i] = initval; 631 cte->level2[i] = initval;
644 632
645 return wrap_char_table_entry (cte); 633 return wrap_char_table_entry (cte);
649 copy_char_table_entry (Lisp_Object entry) 637 copy_char_table_entry (Lisp_Object entry)
650 { 638 {
651 Lisp_Char_Table_Entry *cte = XCHAR_TABLE_ENTRY (entry); 639 Lisp_Char_Table_Entry *cte = XCHAR_TABLE_ENTRY (entry);
652 int i; 640 int i;
653 Lisp_Char_Table_Entry *ctenew = 641 Lisp_Char_Table_Entry *ctenew =
654 #ifdef MC_ALLOC 642 ALLOC_LCRECORD_TYPE (Lisp_Char_Table_Entry, &lrecord_char_table_entry);
655 alloc_lrecord_type (Lisp_Char_Table_Entry, &lrecord_char_table_entry);
656 #else /* not MC_ALLOC */
657 alloc_lcrecord_type (Lisp_Char_Table_Entry, &lrecord_char_table_entry);
658 #endif /* not MC_ALLOC */
659 643
660 for (i = 0; i < 96; i++) 644 for (i = 0; i < 96; i++)
661 { 645 {
662 Lisp_Object new = cte->level2[i]; 646 Lisp_Object new = cte->level2[i];
663 if (CHAR_TABLE_ENTRYP (new)) 647 if (CHAR_TABLE_ENTRYP (new))
682 Lisp_Object obj; 666 Lisp_Object obj;
683 int i; 667 int i;
684 668
685 CHECK_CHAR_TABLE (char_table); 669 CHECK_CHAR_TABLE (char_table);
686 ct = XCHAR_TABLE (char_table); 670 ct = XCHAR_TABLE (char_table);
687 #ifdef MC_ALLOC 671 ctnew = ALLOC_LCRECORD_TYPE (Lisp_Char_Table, &lrecord_char_table);
688 ctnew = alloc_lrecord_type (Lisp_Char_Table, &lrecord_char_table);
689 #else /* not MC_ALLOC */
690 ctnew = alloc_lcrecord_type (Lisp_Char_Table, &lrecord_char_table);
691 #endif /* not MC_ALLOC */
692 ctnew->type = ct->type; 672 ctnew->type = ct->type;
693 ctnew->parent = ct->parent; 673 ctnew->parent = ct->parent;
694 ctnew->default_ = ct->default_; 674 ctnew->default_ = ct->default_;
695 ctnew->mirror_table_p = ct->mirror_table_p; 675 ctnew->mirror_table_p = ct->mirror_table_p;
696 obj = wrap_char_table (ctnew); 676 obj = wrap_char_table (ctnew);
1078 else 1058 else
1079 { 1059 {
1080 int lb = XCHARSET_LEADING_BYTE (range->charset) - MIN_LEADING_BYTE; 1060 int lb = XCHARSET_LEADING_BYTE (range->charset) - MIN_LEADING_BYTE;
1081 if (CHAR_TABLE_ENTRYP (ct->level1[lb]) && 1061 if (CHAR_TABLE_ENTRYP (ct->level1[lb]) &&
1082 !OBJECT_DUMPED_P (ct->level1[lb])) 1062 !OBJECT_DUMPED_P (ct->level1[lb]))
1083 #ifdef MC_ALLOC 1063 FREE_LCRECORD (ct->level1[lb]);
1084 free_lrecord (ct->level1[lb]);
1085 #else /* not MC_ALLOC */
1086 free_lcrecord (ct->level1[lb]);
1087 #endif /* not MC_ALLOC */
1088 ct->level1[lb] = val; 1064 ct->level1[lb] = val;
1089 } 1065 }
1090 break; 1066 break;
1091 1067
1092 case CHARTAB_RANGE_ROW: 1068 case CHARTAB_RANGE_ROW: