diff mbox

[7/9] Remove Guile mark functions that don't mark anything

Message ID 1397060028-18158-8-git-send-email-wingo@igalia.com
State Changes Requested
Headers show

Commit Message

Andy Wingo April 9, 2014, 4:13 p.m. UTC
* gdb/guile/scm-arch.c (arscm_mark_arch_smob):
* gdb/guile/scm-block.c (bkscm_mark_block_smob)
  (bkscm_mark_block_syms_progress_smob):
* gdb/guile/scm-frame.c (frscm_mark_frame_smob):
* gdb/guile/scm-lazy-string.c (arscm_mark_arch_smob):
* gdb/guile/scm-symbol.c (lsscm_mark_lazy_string_smob):
* gdb/guile/scm-symtab.c (syscm_mark_symbol_smob):
* gdb/guile/scm-type.c (tyscm_mark_type_smob): Remove useless mark
  functions.
---
 gdb/guile/scm-arch.c        |  9 ---------
 gdb/guile/scm-block.c       | 19 -------------------
 gdb/guile/scm-frame.c       |  9 ---------
 gdb/guile/scm-lazy-string.c |  9 ---------
 gdb/guile/scm-symbol.c      |  9 ---------
 gdb/guile/scm-symtab.c      |  9 ---------
 gdb/guile/scm-type.c        |  9 ---------
 7 files changed, 73 deletions(-)

Comments

Doug Evans April 12, 2014, 7:29 p.m. UTC | #1
Andy Wingo <wingo@igalia.com> writes:

> * gdb/guile/scm-arch.c (arscm_mark_arch_smob):
> * gdb/guile/scm-block.c (bkscm_mark_block_smob)
>   (bkscm_mark_block_syms_progress_smob):
> * gdb/guile/scm-frame.c (frscm_mark_frame_smob):
> * gdb/guile/scm-lazy-string.c (arscm_mark_arch_smob):
> * gdb/guile/scm-symbol.c (lsscm_mark_lazy_string_smob):
> * gdb/guile/scm-symtab.c (syscm_mark_symbol_smob):
> * gdb/guile/scm-type.c (tyscm_mark_type_smob): Remove useless mark
>   functions.
> ---
>  gdb/guile/scm-arch.c        |  9 ---------
>  gdb/guile/scm-block.c       | 19 -------------------
>  gdb/guile/scm-frame.c       |  9 ---------
>  gdb/guile/scm-lazy-string.c |  9 ---------
>  gdb/guile/scm-symbol.c      |  9 ---------
>  gdb/guile/scm-symtab.c      |  9 ---------
>  gdb/guile/scm-type.c        |  9 ---------
>  7 files changed, 73 deletions(-)

This is ok with the requisite changelog entry corrections.

These functions were useful during early development, but I guess we're
passed that point now.
Andy Wingo April 17, 2014, 9:48 a.m. UTC | #2
On Sat 12 Apr 2014 21:29, Doug Evans <xdje42@gmail.com> writes:

> Andy Wingo <wingo@igalia.com> writes:
>
>> * gdb/guile/scm-arch.c (arscm_mark_arch_smob):
>> * gdb/guile/scm-block.c (bkscm_mark_block_smob)
>>   (bkscm_mark_block_syms_progress_smob):
>> * gdb/guile/scm-frame.c (frscm_mark_frame_smob):
>> * gdb/guile/scm-lazy-string.c (arscm_mark_arch_smob):
>> * gdb/guile/scm-symbol.c (lsscm_mark_lazy_string_smob):
>> * gdb/guile/scm-symtab.c (syscm_mark_symbol_smob):
>> * gdb/guile/scm-type.c (tyscm_mark_type_smob): Remove useless mark
>>   functions.
>> ---
>>  gdb/guile/scm-arch.c        |  9 ---------
>>  gdb/guile/scm-block.c       | 19 -------------------
>>  gdb/guile/scm-frame.c       |  9 ---------
>>  gdb/guile/scm-lazy-string.c |  9 ---------
>>  gdb/guile/scm-symbol.c      |  9 ---------
>>  gdb/guile/scm-symtab.c      |  9 ---------
>>  gdb/guile/scm-type.c        |  9 ---------
>>  7 files changed, 73 deletions(-)
>
> This is ok with the requisite changelog entry corrections.
>
> These functions were useful during early development, but I guess we're
> passed that point now.

Just FYI, mark functions are actively harmful, and should be avoided if
possible.  They slow down allocation, slow down GC, and, more
importantly, are very tricky to write correctly.  See:

  https://lists.gnu.org/archive/html/guile-user/2011-11/msg00069.html

Regards,

Andy
Doug Evans April 20, 2014, 7:34 p.m. UTC | #3
On Thu, Apr 17, 2014 at 2:48 AM, Andy Wingo <wingo@igalia.com> wrote:
> Just FYI, mark functions are actively harmful, and should be avoided if
> possible.  They slow down allocation, slow down GC, and, more
> importantly, are very tricky to write correctly.  See:
>
>   https://lists.gnu.org/archive/html/guile-user/2011-11/msg00069.html

This sounds like it's *critical* to document somewhere in the Guile
docs, at least including the smob writer docs.  Did I miss it?
Andy Wingo April 22, 2014, 7:39 a.m. UTC | #4
On Sun 20 Apr 2014 21:34, Doug Evans <xdje42@gmail.com> writes:

> On Thu, Apr 17, 2014 at 2:48 AM, Andy Wingo <wingo@igalia.com> wrote:
>> Just FYI, mark functions are actively harmful, and should be avoided if
>> possible.  They slow down allocation, slow down GC, and, more
>> importantly, are very tricky to write correctly.  See:
>>
>>   https://lists.gnu.org/archive/html/guile-user/2011-11/msg00069.html
>
> This sounds like it's *critical* to document somewhere in the Guile
> docs, at least including the smob writer docs.  Did I miss it?

Yes, you are right.  I will work on documenting it.

Andy
Ludovic Courtès April 29, 2014, 11:51 a.m. UTC | #5
Doug Evans <xdje42@gmail.com> skribis:

> On Thu, Apr 17, 2014 at 2:48 AM, Andy Wingo <wingo@igalia.com> wrote:
>> Just FYI, mark functions are actively harmful, and should be avoided if
>> possible.  They slow down allocation, slow down GC, and, more
>> importantly, are very tricky to write correctly.  See:
>>
>>   https://lists.gnu.org/archive/html/guile-user/2011-11/msg00069.html
>
> This sounds like it's *critical* to document somewhere in the Guile
> docs, at least including the smob writer docs.  Did I miss it?

I tried a bit of that for 2.0.10 in response to a discussion we had:

  http://git.savannah.gnu.org/cgit/guile.git/commit/?id=f07c349eb38d6c7b160b8980fc4007fb502e3433

Ludo’.
diff mbox

Patch

diff --git a/gdb/guile/scm-arch.c b/gdb/guile/scm-arch.c
index 6a805c6..e4f85bf 100644
--- a/gdb/guile/scm-arch.c
+++ b/gdb/guile/scm-arch.c
@@ -45,14 +45,6 @@  static int arscm_is_arch (SCM);
 
 /* Administrivia for arch smobs.  */
 
-/* The smob "mark" function for <gdb:arch>.  */
-
-static SCM
-arscm_mark_arch_smob (SCM self)
-{
-  return SCM_BOOL_F;
-}
-
 /* The smob "print" function for <gdb:arch>.  */
 
 static int
@@ -651,7 +643,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 8f39e7c..a8a949f 100644
--- a/gdb/guile/scm-block.c
+++ b/gdb/guile/scm-block.c
@@ -117,14 +117,6 @@  bkscm_objfile_block_map (struct objfile *objfile)
   return htab;
 }
 
-/* The smob "mark" function for <gdb:block>.  */
-
-static SCM
-bkscm_mark_block_smob (SCM self)
-{
-  return SCM_BOOL_F;
-}
-
 /* The smob "free" function for <gdb:block>.  */
 
 static size_t
@@ -529,14 +521,6 @@  gdbscm_block_symbols (SCM self)
 /* The <gdb:block-symbols-iterator> object,
    for iterating over all symbols in a block.  */
 
-/* The smob "mark" function for <gdb:block-symbols-iterator>.  */
-
-static SCM
-bkscm_mark_block_syms_progress_smob (SCM self)
-{
-  return SCM_BOOL_F;
-}
-
 /* The smob "print" function for <gdb:block-symbols-iterator>.  */
 
 static int
@@ -787,15 +771,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-frame.c b/gdb/guile/scm-frame.c
index ee30597..8800923 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 <gdb:frame>.  */
-
-static SCM
-frscm_mark_frame_smob (SCM self)
-{
-  return SCM_BOOL_F;
-}
-
 /* The smob "free" function for <gdb:frame>.  */
 
 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-lazy-string.c b/gdb/guile/scm-lazy-string.c
index 9409379..0ba09f0 100644
--- a/gdb/guile/scm-lazy-string.c
+++ b/gdb/guile/scm-lazy-string.c
@@ -60,14 +60,6 @@  static scm_t_bits lazy_string_smob_tag;
 
 /* Administrivia for lazy string smobs.  */
 
-/* The smob "mark" function for <gdb:lazy-string>.  */
-
-static SCM
-lsscm_mark_lazy_string_smob (SCM self)
-{
-  return SCM_BOOL_F;
-}
-
 /* The smob "free" function for <gdb:lazy-string>.  */
 
 static size_t
@@ -358,7 +350,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-symbol.c b/gdb/guile/scm-symbol.c
index b6a92a4..cdc92ef 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 <gdb:symbol>.  */
-
-static SCM
-syscm_mark_symbol_smob (SCM self)
-{
-  return SCM_BOOL_F;
-}
-
 /* The smob "free" function for <gdb:symbol>.  */
 
 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 9c7f51c..2d09da3 100644
--- a/gdb/guile/scm-symtab.c
+++ b/gdb/guile/scm-symtab.c
@@ -119,14 +119,6 @@  stscm_objfile_symtab_map (struct symtab *symtab)
   return htab;
 }
 
-/* The smob "mark" function for <gdb:symtab>.  */
-
-static SCM
-stscm_mark_symtab_smob (SCM self)
-{
-  return SCM_BOOL_F;
-}
-
 /* The smob "free" function for <gdb:symtab>.  */
 
 static size_t
@@ -706,7 +698,6 @@  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);
 
diff --git a/gdb/guile/scm-type.c b/gdb/guile/scm-type.c
index b65c06a..4e09cbc 100644
--- a/gdb/guile/scm-type.c
+++ b/gdb/guile/scm-type.c
@@ -178,14 +178,6 @@  tyscm_type_map (struct type *type)
   return htab;
 }
 
-/* The smob "mark" function for <gdb:type>.  */
-
-static SCM
-tyscm_mark_type_smob (SCM self)
-{
-  return SCM_BOOL_F;
-}
-
 /* The smob "free" function for <gdb:type>.  */
 
 static size_t
@@ -1471,7 +1463,6 @@  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);