1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-07-03 16:20:39 +02:00

Remove unused "malloc objects"

* libguile/mallocs.c:
* libguile/mallocs.h: Delete files.  These exposed a SMOB interface for
traced mallocs, which is not compatible with precise tracing, and was
unused and undocumented.
* libguile.h:
* libguile/Makefile.am:
* libguile/init.c: Remove mallocs.
* libguile/options.c:
* libguile/ports.c: Remove useless mallocs.h includes
This commit is contained in:
Andy Wingo 2025-06-16 13:42:04 +02:00
parent 383b67c9f1
commit d1b548033c
7 changed files with 1 additions and 116 deletions

View file

@ -71,7 +71,6 @@ extern "C" {
#include "libguile/list.h" #include "libguile/list.h"
#include "libguile/load.h" #include "libguile/load.h"
#include "libguile/macros.h" #include "libguile/macros.h"
#include "libguile/mallocs.h"
#include "libguile/modules.h" #include "libguile/modules.h"
#include "libguile/net_db.h" #include "libguile/net_db.h"
#include "libguile/numbers.h" #include "libguile/numbers.h"

View file

@ -189,7 +189,6 @@ libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES = \
load.c \ load.c \
loader.c \ loader.c \
macros.c \ macros.c \
mallocs.c \
memoize.c \ memoize.c \
modules.c \ modules.c \
null-threads.c \ null-threads.c \
@ -298,7 +297,6 @@ DOT_X_FILES = \
load.x \ load.x \
loader.x \ loader.x \
macros.x \ macros.x \
mallocs.x \
memoize.x \ memoize.x \
modules.x \ modules.x \
numbers.x \ numbers.x \
@ -393,7 +391,6 @@ DOT_DOC_FILES = \
list.doc \ list.doc \
load.doc \ load.doc \
macros.doc \ macros.doc \
mallocs.doc \
memoize.doc \ memoize.doc \
modules.doc \ modules.doc \
numbers.doc \ numbers.doc \
@ -641,7 +638,6 @@ modinclude_HEADERS = \
load.h \ load.h \
loader.h \ loader.h \
macros.h \ macros.h \
mallocs.h \
memoize.h \ memoize.h \
modules.h \ modules.h \
net_db.h \ net_db.h \

View file

@ -92,7 +92,6 @@
#include "load.h" #include "load.h"
#include "loader.h" #include "loader.h"
#include "macros.h" #include "macros.h"
#include "mallocs.h"
#include "memoize.h" #include "memoize.h"
#include "modules.h" #include "modules.h"
#include "net_db.h" #include "net_db.h"
@ -405,7 +404,6 @@ scm_i_init_guile (struct gc_stack_addr base)
scm_init_list (); scm_init_list ();
scm_init_random (); /* Requires smob_prehistory */ scm_init_random (); /* Requires smob_prehistory */
scm_init_macros (); /* Requires smob_prehistory and random */ scm_init_macros (); /* Requires smob_prehistory and random */
scm_init_mallocs (); /* Requires smob_prehistory */
scm_init_modules (); /* Requires smob_prehistory */ scm_init_modules (); /* Requires smob_prehistory */
scm_init_numbers (); scm_init_numbers ();
scm_init_options (); scm_init_options ();

View file

@ -1,67 +0,0 @@
/* Copyright 1995-1998,2000-2001,2006,2011,2014,2018
Free Software Foundation, Inc.
This file is part of Guile.
Guile is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Guile is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with Guile. If not, see
<https://www.gnu.org/licenses/>. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <stdlib.h>
#include <unistd.h>
#include "ports.h"
#include "smob.h"
#include "mallocs.h"
scm_t_bits scm_tc16_malloc;
static int
malloc_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED)
{
scm_puts ("#<malloc ", port);
scm_uintprint (SCM_SMOB_DATA (exp), 16, port);
scm_putc ('>', port);
return 1;
}
SCM
scm_malloc_obj (size_t n)
{
scm_t_bits mem = n ? (scm_t_bits) scm_gc_malloc (n, "malloc smob") : 0;
if (n && !mem)
return SCM_BOOL_F;
SCM_RETURN_NEWSMOB (scm_tc16_malloc, mem);
}
void
scm_init_mallocs ()
{
scm_tc16_malloc = scm_make_smob_type ("malloc", 0);
scm_set_smob_print (scm_tc16_malloc, malloc_print);
}

View file

@ -1,39 +0,0 @@
#ifndef SCM_MALLOCS_H
#define SCM_MALLOCS_H
/* Copyright 1995,2000,2006,2008,2018
Free Software Foundation, Inc.
This file is part of Guile.
Guile is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Guile is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with Guile. If not, see
<https://www.gnu.org/licenses/>. */
#include "libguile/scm.h"
SCM_API scm_t_bits scm_tc16_malloc;
#define SCM_MALLOCP(X) (SCM_SMOB_PREDICATE (scm_tc16_malloc, (X)))
#define SCM_MALLOCDATA(obj) ((char *) SCM_SMOB_DATA (obj))
#define SCM_SETMALLOCDATA(obj, val) (SCM_SET_SMOB_DATA ((obj), (val)))
SCM_API SCM scm_malloc_obj (size_t n);
SCM_INTERNAL void scm_init_mallocs (void);
#endif /* SCM_MALLOCS_H */

View file

@ -1,4 +1,4 @@
/* Copyright 1995-1996,1998,2000-2001,2006,2008-2011,2018 /* Copyright 1995-1996,1998,2000-2001,2006,2008-2011,2018,2025
Free Software Foundation, Inc. Free Software Foundation, Inc.
This file is part of Guile. This file is part of Guile.
@ -24,7 +24,6 @@
#include "boolean.h" #include "boolean.h"
#include "list.h" #include "list.h"
#include "mallocs.h"
#include "numbers.h" #include "numbers.h"
#include "pairs.h" #include "pairs.h"
#include "strings.h" #include "strings.h"

View file

@ -64,7 +64,6 @@
#include "gsubr.h" #include "gsubr.h"
#include "hashtab.h" #include "hashtab.h"
#include "keywords.h" #include "keywords.h"
#include "mallocs.h"
#include "modules.h" #include "modules.h"
#include "numbers.h" #include "numbers.h"
#include "pairs.h" #include "pairs.h"