From 92c48fc5e7f59ba3813cba60277f5c3f12bfb574 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Mon, 26 May 2014 18:11:58 -0700 Subject: [PATCH] remove unnecessary smob mark/free functions * guile/scm-arch.c (arscm_mark_arch_smob): * guile/scm-block.c (bkscm_mark_block_smob) (bkscm_mark_block_syms_progress_smob): * guile/scm-breakpoint.c (bpscm_mark_breakpoint_smob): * guile/scm-exception.c (exscm_mark_exception_smob): * guile/scm-frame.c (frscm_mark_frame_smob): * guile/scm-iterator.c (itscm_mark_iterator_smob): * guile/scm-lazy-string.c (lsscm_mark_lazy_string_smob): * guile/scm-objfile.c (ofscm_mark_objfile_smob): * guile/scm-pretty-print.c (ppscm_mark_pretty_printer_smob) (ppscm_mark_pretty_printer_worker_smob): * guile/scm-symbol.c (syscm_mark_symbol_smob): * guile/scm-symtab.c (stscm_mark_symtab_smob, stscm_mark_sal_smob): * guile/scm-type.c (tyscm_mark_type_smob, tyscm_mark_field_smob): * guile/scm-value.c (vlscm_mark_value_smob): Remove unnecessary mark functions. * guile/scm-symtab.c (stscm_free_sal_smob): Remove unnecessary free function. --- gdb/ChangeLog | 21 +++++++++++++++++++++ gdb/guile/scm-arch.c | 9 --------- gdb/guile/scm-block.c | 19 ------------------- gdb/guile/scm-breakpoint.c | 14 -------------- gdb/guile/scm-exception.c | 12 ------------ gdb/guile/scm-frame.c | 9 --------- gdb/guile/scm-iterator.c | 13 ------------- gdb/guile/scm-lazy-string.c | 9 --------- gdb/guile/scm-objfile.c | 14 -------------- gdb/guile/scm-pretty-print.c | 29 ----------------------------- gdb/guile/scm-symbol.c | 9 --------- gdb/guile/scm-symtab.c | 34 ---------------------------------- gdb/guile/scm-type.c | 20 -------------------- gdb/guile/scm-value.c | 13 ------------- 14 files changed, 21 insertions(+), 204 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 37305f499f..088076955f 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,24 @@ +2014-05-26 Andy Wingo + + * guile/scm-arch.c (arscm_mark_arch_smob): + * guile/scm-block.c (bkscm_mark_block_smob) + (bkscm_mark_block_syms_progress_smob): + * guile/scm-breakpoint.c (bpscm_mark_breakpoint_smob): + * guile/scm-exception.c (exscm_mark_exception_smob): + * guile/scm-frame.c (frscm_mark_frame_smob): + * guile/scm-iterator.c (itscm_mark_iterator_smob): + * guile/scm-lazy-string.c (lsscm_mark_lazy_string_smob): + * guile/scm-objfile.c (ofscm_mark_objfile_smob): + * guile/scm-pretty-print.c (ppscm_mark_pretty_printer_smob) + (ppscm_mark_pretty_printer_worker_smob): + * guile/scm-symbol.c (syscm_mark_symbol_smob): + * guile/scm-symtab.c (stscm_mark_symtab_smob, stscm_mark_sal_smob): + * guile/scm-type.c (tyscm_mark_type_smob, tyscm_mark_field_smob): + * guile/scm-value.c (vlscm_mark_value_smob): Remove unnecessary + mark functions. + * guile/scm-symtab.c (stscm_free_sal_smob): Remove unnecessary free + function. + 2014-05-26 Andy Wingo Doug Evans diff --git a/gdb/guile/scm-arch.c b/gdb/guile/scm-arch.c index aa170f0e6d..0b3e95ae6d 100644 --- a/gdb/guile/scm-arch.c +++ b/gdb/guile/scm-arch.c @@ -48,14 +48,6 @@ static int arscm_is_arch (SCM); /* Administrivia for arch smobs. */ -/* The smob "mark" function for . */ - -static SCM -arscm_mark_arch_smob (SCM self) -{ - return SCM_BOOL_F; -} - /* The smob "print" function for . */ static int @@ -655,7 +647,6 @@ void gdbscm_initialize_arches (void) { arch_smob_tag = gdbscm_make_smob_type (arch_smob_name, sizeof (arch_smob)); - scm_set_smob_mark (arch_smob_tag, arscm_mark_arch_smob); scm_set_smob_print (arch_smob_tag, arscm_print_arch_smob); gdbscm_define_functions (arch_functions, 1); diff --git a/gdb/guile/scm-block.c b/gdb/guile/scm-block.c index 94c171efa2..22900085e8 100644 --- a/gdb/guile/scm-block.c +++ b/gdb/guile/scm-block.c @@ -120,14 +120,6 @@ bkscm_objfile_block_map (struct objfile *objfile) return htab; } -/* The smob "mark" function for . */ - -static SCM -bkscm_mark_block_smob (SCM self) -{ - return SCM_BOOL_F; -} - /* The smob "free" function for . */ static size_t @@ -532,14 +524,6 @@ gdbscm_block_symbols (SCM self) /* The object, for iterating over all symbols in a block. */ -/* The smob "mark" function for . */ - -static SCM -bkscm_mark_block_syms_progress_smob (SCM self) -{ - return SCM_BOOL_F; -} - /* The smob "print" function for . */ static int @@ -791,15 +775,12 @@ gdbscm_initialize_blocks (void) { block_smob_tag = gdbscm_make_smob_type (block_smob_name, sizeof (block_smob)); - scm_set_smob_mark (block_smob_tag, bkscm_mark_block_smob); scm_set_smob_free (block_smob_tag, bkscm_free_block_smob); scm_set_smob_print (block_smob_tag, bkscm_print_block_smob); block_syms_progress_smob_tag = gdbscm_make_smob_type (block_syms_progress_smob_name, sizeof (block_syms_progress_smob)); - scm_set_smob_mark (block_syms_progress_smob_tag, - bkscm_mark_block_syms_progress_smob); scm_set_smob_print (block_syms_progress_smob_tag, bkscm_print_block_syms_progress_smob); diff --git a/gdb/guile/scm-breakpoint.c b/gdb/guile/scm-breakpoint.c index 97621b8e82..7edb97d1ec 100644 --- a/gdb/guile/scm-breakpoint.c +++ b/gdb/guile/scm-breakpoint.c @@ -73,19 +73,6 @@ static SCM internal_keyword; /* Administrivia for breakpoint smobs. */ -/* The smob "mark" function for . */ - -static SCM -bpscm_mark_breakpoint_smob (SCM self) -{ - breakpoint_smob *bp_smob = (breakpoint_smob *) SCM_SMOB_DATA (self); - - /* We don't mark containing_scm here. It is just a backlink to our - container, and is gc'protected until the breakpoint is deleted. */ - - return bp_smob->stop; -} - /* The smob "free" function for . */ static size_t @@ -1181,7 +1168,6 @@ gdbscm_initialize_breakpoints (void) { breakpoint_smob_tag = gdbscm_make_smob_type (breakpoint_smob_name, sizeof (breakpoint_smob)); - scm_set_smob_mark (breakpoint_smob_tag, bpscm_mark_breakpoint_smob); scm_set_smob_free (breakpoint_smob_tag, bpscm_free_breakpoint_smob); scm_set_smob_print (breakpoint_smob_tag, bpscm_print_breakpoint_smob); diff --git a/gdb/guile/scm-exception.c b/gdb/guile/scm-exception.c index c892884b54..f773a7d0dd 100644 --- a/gdb/guile/scm-exception.c +++ b/gdb/guile/scm-exception.c @@ -101,17 +101,6 @@ static unsigned long gdbscm_exception_count = 0; /* Administrivia for exception smobs. */ -/* The smob "mark" function for . */ - -static SCM -exscm_mark_exception_smob (SCM self) -{ - exception_smob *e_smob = (exception_smob *) SCM_SMOB_DATA (self); - - scm_gc_mark (e_smob->key); - return e_smob->args; -} - /* The smob "print" function for . */ static int @@ -665,7 +654,6 @@ gdbscm_initialize_exceptions (void) { exception_smob_tag = gdbscm_make_smob_type (exception_smob_name, sizeof (exception_smob)); - scm_set_smob_mark (exception_smob_tag, exscm_mark_exception_smob); scm_set_smob_print (exception_smob_tag, exscm_print_exception_smob); gdbscm_define_functions (exception_functions, 1); diff --git a/gdb/guile/scm-frame.c b/gdb/guile/scm-frame.c index ee30597651..8800923037 100644 --- a/gdb/guile/scm-frame.c +++ b/gdb/guile/scm-frame.c @@ -130,14 +130,6 @@ frscm_inferior_frame_map (struct inferior *inferior) return htab; } -/* The smob "mark" function for . */ - -static SCM -frscm_mark_frame_smob (SCM self) -{ - return SCM_BOOL_F; -} - /* The smob "free" function for . */ static size_t @@ -1058,7 +1050,6 @@ gdbscm_initialize_frames (void) { frame_smob_tag = gdbscm_make_smob_type (frame_smob_name, sizeof (frame_smob)); - scm_set_smob_mark (frame_smob_tag, frscm_mark_frame_smob); scm_set_smob_free (frame_smob_tag, frscm_free_frame_smob); scm_set_smob_print (frame_smob_tag, frscm_print_frame_smob); diff --git a/gdb/guile/scm-iterator.c b/gdb/guile/scm-iterator.c index e0155a9d4a..b7bea2659a 100644 --- a/gdb/guile/scm-iterator.c +++ b/gdb/guile/scm-iterator.c @@ -110,18 +110,6 @@ itscm_set_iterator_smob_progress_x (iterator_smob *i_smob, SCM progress) /* Administrivia for iterator smobs. */ -/* The smob "mark" function for . */ - -static SCM -itscm_mark_iterator_smob (SCM self) -{ - iterator_smob *i_smob = (iterator_smob *) SCM_SMOB_DATA (self); - - scm_gc_mark (i_smob->object); - scm_gc_mark (i_smob->progress); - return i_smob->next_x; -} - /* The smob "print" function for . */ static int @@ -362,7 +350,6 @@ gdbscm_initialize_iterators (void) { iterator_smob_tag = gdbscm_make_smob_type (iterator_smob_name, sizeof (iterator_smob)); - scm_set_smob_mark (iterator_smob_tag, itscm_mark_iterator_smob); scm_set_smob_print (iterator_smob_tag, itscm_print_iterator_smob); gdbscm_define_functions (iterator_functions, 1); diff --git a/gdb/guile/scm-lazy-string.c b/gdb/guile/scm-lazy-string.c index 10494ea2ee..a34cb60d8a 100644 --- a/gdb/guile/scm-lazy-string.c +++ b/gdb/guile/scm-lazy-string.c @@ -63,14 +63,6 @@ static scm_t_bits lazy_string_smob_tag; /* Administrivia for lazy string smobs. */ -/* The smob "mark" function for . */ - -static SCM -lsscm_mark_lazy_string_smob (SCM self) -{ - return SCM_BOOL_F; -} - /* The smob "free" function for . */ static size_t @@ -362,7 +354,6 @@ gdbscm_initialize_lazy_strings (void) { lazy_string_smob_tag = gdbscm_make_smob_type (lazy_string_smob_name, sizeof (lazy_string_smob)); - scm_set_smob_mark (lazy_string_smob_tag, lsscm_mark_lazy_string_smob); scm_set_smob_free (lazy_string_smob_tag, lsscm_free_lazy_string_smob); scm_set_smob_print (lazy_string_smob_tag, lsscm_print_lazy_string_smob); diff --git a/gdb/guile/scm-objfile.c b/gdb/guile/scm-objfile.c index 145f22bd64..54e4699234 100644 --- a/gdb/guile/scm-objfile.c +++ b/gdb/guile/scm-objfile.c @@ -62,19 +62,6 @@ ofscm_objfile_smob_pretty_printers (objfile_smob *o_smob) /* Administrivia for objfile smobs. */ -/* The smob "mark" function for . */ - -static SCM -ofscm_mark_objfile_smob (SCM self) -{ - objfile_smob *o_smob = (objfile_smob *) SCM_SMOB_DATA (self); - - /* We don't mark containing_scm here. It is just a backlink to our - container, and is gc-protected until the objfile is deleted. */ - - return o_smob->pretty_printers; -} - /* The smob "print" function for . */ static int @@ -400,7 +387,6 @@ gdbscm_initialize_objfiles (void) { objfile_smob_tag = gdbscm_make_smob_type (objfile_smob_name, sizeof (objfile_smob)); - scm_set_smob_mark (objfile_smob_tag, ofscm_mark_objfile_smob); scm_set_smob_print (objfile_smob_tag, ofscm_print_objfile_smob); gdbscm_define_functions (objfile_functions, 1); diff --git a/gdb/guile/scm-pretty-print.c b/gdb/guile/scm-pretty-print.c index cc97dcdb89..6aa911912f 100644 --- a/gdb/guile/scm-pretty-print.c +++ b/gdb/guile/scm-pretty-print.c @@ -127,18 +127,6 @@ static SCM ppscm_string_string; /* Administrivia for pretty-printer matcher smobs. */ -/* The smob "mark" function for . */ - -static SCM -ppscm_mark_pretty_printer_smob (SCM self) -{ - pretty_printer_smob *pp_smob = (pretty_printer_smob *) SCM_SMOB_DATA (self); - - scm_gc_mark (pp_smob->name); - scm_gc_mark (pp_smob->enabled); - return pp_smob->lookup; -} - /* The smob "print" function for . */ static int @@ -255,19 +243,6 @@ gdbscm_set_pretty_printer_enabled_x (SCM self, SCM enabled) /* Administrivia for pretty-printer-worker smobs. These are created when a matcher recognizes a value. */ -/* The smob "mark" function for . */ - -static SCM -ppscm_mark_pretty_printer_worker_smob (SCM self) -{ - pretty_printer_worker_smob *w_smob - = (pretty_printer_worker_smob *) SCM_SMOB_DATA (self); - - scm_gc_mark (w_smob->display_hint); - scm_gc_mark (w_smob->to_string); - return w_smob->children; -} - /* The smob "print" function for . */ static int @@ -1104,16 +1079,12 @@ gdbscm_initialize_pretty_printers (void) pretty_printer_smob_tag = gdbscm_make_smob_type (pretty_printer_smob_name, sizeof (pretty_printer_smob)); - scm_set_smob_mark (pretty_printer_smob_tag, - ppscm_mark_pretty_printer_smob); scm_set_smob_print (pretty_printer_smob_tag, ppscm_print_pretty_printer_smob); pretty_printer_worker_smob_tag = gdbscm_make_smob_type (pretty_printer_worker_smob_name, sizeof (pretty_printer_worker_smob)); - scm_set_smob_mark (pretty_printer_worker_smob_tag, - ppscm_mark_pretty_printer_worker_smob); scm_set_smob_print (pretty_printer_worker_smob_tag, ppscm_print_pretty_printer_worker_smob); diff --git a/gdb/guile/scm-symbol.c b/gdb/guile/scm-symbol.c index b6a92a4d48..cdc92ef419 100644 --- a/gdb/guile/scm-symbol.c +++ b/gdb/guile/scm-symbol.c @@ -95,14 +95,6 @@ syscm_objfile_symbol_map (struct symbol *symbol) return htab; } -/* The smob "mark" function for . */ - -static SCM -syscm_mark_symbol_smob (SCM self) -{ - return SCM_BOOL_F; -} - /* The smob "free" function for . */ static size_t @@ -756,7 +748,6 @@ gdbscm_initialize_symbols (void) { symbol_smob_tag = gdbscm_make_smob_type (symbol_smob_name, sizeof (symbol_smob)); - scm_set_smob_mark (symbol_smob_tag, syscm_mark_symbol_smob); scm_set_smob_free (symbol_smob_tag, syscm_free_symbol_smob); scm_set_smob_print (symbol_smob_tag, syscm_print_symbol_smob); diff --git a/gdb/guile/scm-symtab.c b/gdb/guile/scm-symtab.c index 845b13f69b..dbf9f7dc01 100644 --- a/gdb/guile/scm-symtab.c +++ b/gdb/guile/scm-symtab.c @@ -122,14 +122,6 @@ stscm_objfile_symtab_map (struct symtab *symtab) return htab; } -/* The smob "mark" function for . */ - -static SCM -stscm_mark_symtab_smob (SCM self) -{ - return SCM_BOOL_F; -} - /* The smob "free" function for . */ static size_t @@ -397,29 +389,6 @@ gdbscm_symtab_static_block (SCM self) /* Administrivia for sal (symtab-and-line) smobs. */ -/* The smob "mark" function for . */ - -static SCM -stscm_mark_sal_smob (SCM self) -{ - sal_smob *s_smob = (sal_smob *) SCM_SMOB_DATA (self); - - return s_smob->symtab_scm; -} - -/* The smob "free" function for . */ - -static size_t -stscm_free_sal_smob (SCM self) -{ - sal_smob *s_smob = (sal_smob *) SCM_SMOB_DATA (self); - - /* Not necessary, done to catch bugs. */ - s_smob->symtab_scm = SCM_UNDEFINED; - - return 0; -} - /* The smob "print" function for . */ static int @@ -710,13 +679,10 @@ gdbscm_initialize_symtabs (void) { symtab_smob_tag = gdbscm_make_smob_type (symtab_smob_name, sizeof (symtab_smob)); - scm_set_smob_mark (symtab_smob_tag, stscm_mark_symtab_smob); scm_set_smob_free (symtab_smob_tag, stscm_free_symtab_smob); scm_set_smob_print (symtab_smob_tag, stscm_print_symtab_smob); sal_smob_tag = gdbscm_make_smob_type (sal_smob_name, sizeof (sal_smob)); - scm_set_smob_mark (sal_smob_tag, stscm_mark_sal_smob); - scm_set_smob_free (sal_smob_tag, stscm_free_sal_smob); scm_set_smob_print (sal_smob_tag, stscm_print_sal_smob); gdbscm_define_functions (symtab_functions, 1); diff --git a/gdb/guile/scm-type.c b/gdb/guile/scm-type.c index 8d09fbd531..582a5b7f31 100644 --- a/gdb/guile/scm-type.c +++ b/gdb/guile/scm-type.c @@ -181,14 +181,6 @@ tyscm_type_map (struct type *type) return htab; } -/* The smob "mark" function for . */ - -static SCM -tyscm_mark_type_smob (SCM self) -{ - return SCM_BOOL_F; -} - /* The smob "free" function for . */ static size_t @@ -412,16 +404,6 @@ save_objfile_types (struct objfile *objfile, void *datum) /* Administrivia for field smobs. */ -/* The smob "mark" function for . */ - -static SCM -tyscm_mark_field_smob (SCM self) -{ - field_smob *f_smob = (field_smob *) SCM_SMOB_DATA (self); - - return f_smob->type_scm; -} - /* The smob "print" function for . */ static int @@ -1475,14 +1457,12 @@ void gdbscm_initialize_types (void) { type_smob_tag = gdbscm_make_smob_type (type_smob_name, sizeof (type_smob)); - scm_set_smob_mark (type_smob_tag, tyscm_mark_type_smob); scm_set_smob_free (type_smob_tag, tyscm_free_type_smob); scm_set_smob_print (type_smob_tag, tyscm_print_type_smob); scm_set_smob_equalp (type_smob_tag, tyscm_equal_p_type_smob); field_smob_tag = gdbscm_make_smob_type (field_smob_name, sizeof (field_smob)); - scm_set_smob_mark (field_smob_tag, tyscm_mark_field_smob); scm_set_smob_print (field_smob_tag, tyscm_print_field_smob); gdbscm_define_integer_constants (type_integer_constants, 1); diff --git a/gdb/guile/scm-value.c b/gdb/guile/scm-value.c index 6e82d26df9..8e579a4682 100644 --- a/gdb/guile/scm-value.c +++ b/gdb/guile/scm-value.c @@ -123,18 +123,6 @@ vlscm_forget_value_smob (value_smob *v_smob) v_smob->next->prev = v_smob->prev; } -/* The smob "mark" function for . */ - -static SCM -vlscm_mark_value_smob (SCM self) -{ - value_smob *v_smob = (value_smob *) SCM_SMOB_DATA (self); - - scm_gc_mark (v_smob->address); - scm_gc_mark (v_smob->type); - return v_smob->dynamic_type; -} - /* The smob "free" function for . */ static size_t @@ -1493,7 +1481,6 @@ gdbscm_initialize_values (void) { value_smob_tag = gdbscm_make_smob_type (value_smob_name, sizeof (value_smob)); - scm_set_smob_mark (value_smob_tag, vlscm_mark_value_smob); scm_set_smob_free (value_smob_tag, vlscm_free_value_smob); scm_set_smob_print (value_smob_tag, vlscm_print_value_smob); scm_set_smob_equalp (value_smob_tag, vlscm_equal_p_value_smob); -- 2.34.1