summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libguile/gc.c6
-rw-r--r--libguile/ports.c6
2 files changed, 3 insertions, 9 deletions
diff --git a/libguile/gc.c b/libguile/gc.c
index eb2e15c3c..df78a62b3 100644
--- a/libguile/gc.c
+++ b/libguile/gc.c
@@ -720,12 +720,6 @@ scm_init_storage ()
j = SCM_HEAP_SEG_SIZE;
- /* Initialise the list of ports. */
- scm_i_port_table = (scm_t_port **)
- malloc (sizeof (scm_t_port *) * scm_i_port_table_room);
- if (!scm_i_port_table)
- return 1;
-
#if 0
/* We can't have a cleanup handler since we have no thread to run it
in. */
diff --git a/libguile/ports.c b/libguile/ports.c
index a8d06e0fb..e59e773da 100644
--- a/libguile/ports.c
+++ b/libguile/ports.c
@@ -500,13 +500,13 @@ scm_new_port_table_entry (scm_t_bits tag)
/* initial malloc is in gc.c. this doesn't use scm_gc_malloc etc.,
since it can never be freed during gc. */
/* XXX (Ludo): Why not do it actually? */
+ size_t new_size = scm_i_port_table_room * 2;
void *newt = scm_gc_realloc ((char *) scm_i_port_table,
scm_i_port_table_room * sizeof (scm_t_port *),
- (size_t) (sizeof (scm_t_port *)
- * scm_i_port_table_room * 2),
+ new_size * sizeof (scm_t_port *),
"port-table");
scm_i_port_table = (scm_t_port **) newt;
- scm_i_port_table_room *= 2;
+ scm_i_port_table_room = new_size;
}
entry->entry = scm_i_port_table_size;