X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Fspecifier.c;h=18ba86d6457cd01796c42b5e14b8b37bdcf06be9;hb=89b37a2411db934f00d933d8ac6fa1686f1446e5;hp=9bdf57e20a7729f7566d925e9a625f98791b3805;hpb=caf1416adb403b6334ce635e58b269b6c653aa39;p=chise%2Fxemacs-chise.git.1 diff --git a/src/specifier.c b/src/specifier.c index 9bdf57e..18ba86d 100644 --- a/src/specifier.c +++ b/src/specifier.c @@ -354,16 +354,21 @@ specifier_hash (Lisp_Object obj, int depth) internal_hash (s->buffer_specs, depth + 1)); } +inline static size_t +aligned_sizeof_specifier (size_t specifier_type_specific_size) +{ + return ALIGN_SIZE (offsetof (Lisp_Specifier, data) + + specifier_type_specific_size, + ALIGNOF (max_align_t)); +} + static size_t sizeof_specifier (const void *header) { - if (GHOST_SPECIFIER_P ((Lisp_Specifier *) header)) - return offsetof (Lisp_Specifier, data); - else - { - const Lisp_Specifier *p = (const Lisp_Specifier *) header; - return offsetof (Lisp_Specifier, data) + p->methods->extra_data_size; - } + const Lisp_Specifier *p = (const Lisp_Specifier *) header; + return aligned_sizeof_specifier (GHOST_SPECIFIER_P (p) + ? 0 + : p->methods->extra_data_size); } static const struct lrecord_description specifier_methods_description_1[] = { @@ -476,8 +481,7 @@ make_specifier_internal (struct specifier_methods *spec_meths, { Lisp_Object specifier; Lisp_Specifier *sp = (Lisp_Specifier *) - alloc_lcrecord (offsetof (Lisp_Specifier, data) + data_size, - &lrecord_specifier); + alloc_lcrecord (aligned_sizeof_specifier (data_size), &lrecord_specifier); sp->methods = spec_meths; sp->global_specs = Qnil; @@ -3267,7 +3271,7 @@ void specifier_type_create (void) { the_specifier_type_entry_dynarr = Dynarr_new (specifier_type_entry); - dumpstruct (&the_specifier_type_entry_dynarr, &sted_description); + dump_add_root_struct_ptr (&the_specifier_type_entry_dynarr, &sted_description); Vspecifier_type_list = Qnil; staticpro (&Vspecifier_type_list); @@ -3311,7 +3315,7 @@ vars_of_specifier (void) /* Do NOT mark through this, or specifiers will never be GC'd. This is the same deal as for weak hash tables. */ Vall_specifiers = Qnil; - pdump_wire_list (&Vall_specifiers); + dump_add_weak_object_chain (&Vall_specifiers); Vuser_defined_tags = Qnil; staticpro (&Vuser_defined_tags);